Skip to content

Commit

Permalink
Apply review
Browse files Browse the repository at this point in the history
  • Loading branch information
HalidOdat committed Dec 2, 2023
1 parent e5a8e64 commit 98f447b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions boa_engine/src/builtins/eval/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
use crate::{
builtins::BuiltInObject,
bytecompiler::{ByteCompiler, ToJsString},
bytecompiler::ByteCompiler,
context::intrinsics::Intrinsics,
environments::Environment,
error::JsNativeError,
js_string,
object::JsObject,
realm::Realm,
string::common::StaticJsStrings,
Expand All @@ -23,7 +24,6 @@ use crate::{
};
use boa_ast::operations::{contains, contains_arguments, ContainsSymbol};
use boa_gc::Gc;
use boa_interner::Sym;
use boa_parser::{Parser, Source};
use boa_profiler::Profiler;

Expand Down Expand Up @@ -228,7 +228,7 @@ impl Eval {
let mut var_env = var_environment.compile_env();

let mut compiler = ByteCompiler::new(
Sym::MAIN.to_js_string(context.interner()),
js_string!("<main>"),
body.strict(),
false,
var_env.clone(),
Expand Down
4 changes: 2 additions & 2 deletions boa_engine/src/builtins/function/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use crate::{
builtins::{BuiltInBuilder, BuiltInConstructor, BuiltInObject, IntrinsicObject},
bytecompiler::{FunctionCompiler, ToJsString},
bytecompiler::FunctionCompiler,
context::intrinsics::{Intrinsics, StandardConstructor, StandardConstructors},
environments::{EnvironmentStack, PrivateEnvironment},
error::JsNativeError,
Expand Down Expand Up @@ -557,7 +557,7 @@ impl BuiltInFunctionObject {
};

let code = FunctionCompiler::new()
.name(Sym::ANONYMOUS.to_js_string(context.interner()))
.name(js_string!("anonymous"))
.generator(generator)
.r#async(r#async)
.compile(
Expand Down
5 changes: 2 additions & 3 deletions boa_engine/src/builtins/json/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use itertools::Itertools;

use crate::{
builtins::BuiltInObject,
bytecompiler::{ByteCompiler, ToJsString},
bytecompiler::ByteCompiler,
context::intrinsics::Intrinsics,
error::JsNativeError,
js_string,
Expand All @@ -33,7 +33,6 @@ use crate::{
Context, JsArgs, JsResult, JsString, JsValue,
};
use boa_gc::Gc;
use boa_interner::Sym;
use boa_parser::{Parser, Source};
use boa_profiler::Profiler;

Expand Down Expand Up @@ -114,7 +113,7 @@ impl Json {
let script = parser.parse_script(context.interner_mut())?;
let code_block = {
let mut compiler = ByteCompiler::new(
Sym::MAIN.to_js_string(context.interner()),
js_string!("<main>"),
script.strict(),
true,
context.realm().environment().compile_env(),
Expand Down
5 changes: 3 additions & 2 deletions boa_engine/src/module/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use boa_ast::{
},
};
use boa_gc::{custom_trace, empty_trace, Finalize, Gc, GcRefCell, Trace, WeakGc};
use boa_interner::{Interner, Sym};
use boa_interner::Interner;
use boa_macros::utf16;
use indexmap::IndexSet;
use rustc_hash::{FxHashMap, FxHashSet, FxHasher};
Expand All @@ -25,6 +25,7 @@ use crate::{
builtins::{promise::PromiseCapability, Promise},
bytecompiler::{ByteCompiler, FunctionSpec, ToJsString},
environments::{BindingLocator, CompileTimeEnvironment, EnvironmentStack},
js_string,
module::ModuleKind,
object::{FunctionObjectBuilder, JsPromise, RecursionLimiter},
realm::Realm,
Expand Down Expand Up @@ -1435,7 +1436,7 @@ impl SourceTextModule {
let env = Rc::new(CompileTimeEnvironment::new(global_compile_env, true));

let mut compiler = ByteCompiler::new(
Sym::MAIN.to_js_string(context.interner()),
js_string!("<main>"),
true,
false,
env.clone(),
Expand Down
6 changes: 3 additions & 3 deletions boa_engine/src/module/synthetic.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use std::rc::Rc;

use boa_gc::{Finalize, Gc, GcRefCell, Trace, WeakGc};
use boa_interner::Sym;
use rustc_hash::FxHashSet;

use crate::{
builtins::promise::ResolvingFunctions,
bytecompiler::{ByteCompiler, ToJsString},
bytecompiler::ByteCompiler,
environments::{CompileTimeEnvironment, EnvironmentStack},
js_string,
object::JsPromise,
vm::{ActiveRunnable, CallFrame, CodeBlock},
Context, JsNativeError, JsResult, JsString, JsValue, Module,
Expand Down Expand Up @@ -242,7 +242,7 @@ impl SyntheticModule {
// TODO: A bit of a hack to be able to pass the currently active runnable without an
// available codeblock to execute.
let compiler = ByteCompiler::new(
Sym::MAIN.to_js_string(context.interner()),
js_string!("<main>"),
true,
false,
module_compile_env.clone(),
Expand Down
6 changes: 3 additions & 3 deletions boa_engine/src/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
use std::io::Read;

use boa_gc::{Finalize, Gc, GcRefCell, Trace};
use boa_interner::Sym;
use boa_parser::{Parser, Source};
use boa_profiler::Profiler;
use rustc_hash::FxHashMap;

use crate::{
bytecompiler::{ByteCompiler, ToJsString},
bytecompiler::ByteCompiler,
js_string,
realm::Realm,
vm::{ActiveRunnable, CallFrame, CallFrameFlags, CodeBlock},
Context, HostDefined, JsResult, JsString, JsValue, Module,
Expand Down Expand Up @@ -116,7 +116,7 @@ impl Script {
let _timer = Profiler::global().start_event("Script compilation", "Main");

let mut compiler = ByteCompiler::new(
Sym::MAIN.to_js_string(context.interner()),
js_string!("<main>"),
self.inner.source.strict(),
false,
self.inner.realm.environment().compile_env(),
Expand Down

0 comments on commit 98f447b

Please sign in to comment.