Skip to content

Commit

Permalink
Cleanup tester deps and patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 committed Apr 5, 2024
1 parent 0b3df57 commit d288422
Show file tree
Hide file tree
Showing 10 changed files with 283 additions and 314 deletions.
164 changes: 87 additions & 77 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions core/engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ compile_error!("Boa requires a lock free `AtomicUsize` in order to work properly
extern crate self as boa_engine;
extern crate static_assertions as sa;

pub use boa_parser as parser;
pub use boa_ast as ast;
pub use boa_gc as gc;
pub use boa_interner as interner;

pub mod bigint;
pub mod builtins;
pub mod bytecompiler;
Expand Down
12 changes: 12 additions & 0 deletions core/engine/src/module/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,16 @@ impl ModuleLoader for SimpleModuleLoader {

finish_load(result, context);
}

fn register_module(&self, specifier: JsString, module: Module) {
let path = PathBuf::from(specifier.to_std_string_escaped());

self.insert(path, module)
}

fn get_module(&self, specifier: JsString) -> Option<Module> {
let path = specifier.to_std_string_escaped();

self.get(Path::new(&path))
}
}
2 changes: 1 addition & 1 deletion test262_config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
commit = "6f7ae1f311a7b01ef2358de7f4f6fd42c3ae3839"
commit = "b73f7d662d51584bfee6d3ed274b676d313b646a"

[ignored]
# Not implemented yet:
Expand Down
4 changes: 1 addition & 3 deletions tests/tester/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ boa_runtime.workspace = true
boa_gc.workspace = true
clap = { workspace = true, features = ["derive"] }
serde = { workspace = true, features = ["derive"] }
serde_yaml = "0.9.33"
serde_yaml = "0.9.34" # TODO: Track https://github.com/saphyr-rs/saphyr.
serde_json.workspace = true
bitflags.workspace = true
regex.workspace = true
once_cell.workspace = true
colored.workspace = true
rustc-hash = { workspace = true, features = ["std"] }
rayon = "1.10.0"
Expand Down
12 changes: 12 additions & 0 deletions tests/tester/src/edition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ static FEATURE_EDITION: phf::Map<&'static str, SpecEdition> = phf::phf_map! {
// https://github.com/tc39/proposal-json-parse-with-source
"json-parse-with-source" => SpecEdition::ESNext,

// Regular expression modifiers
// https://github.com/tc39/proposal-regexp-modifiers
"regexp-modifiers" => SpecEdition::ESNext,

// Iterator Helpers
// https://github.com/tc39/proposal-iterator-helpers
"iterator-helpers" => SpecEdition::ESNext,
Expand All @@ -81,6 +85,14 @@ static FEATURE_EDITION: phf::Map<&'static str, SpecEdition> = phf::phf_map! {
// https://github.com/tc39/proposal-set-methods
"set-methods" => SpecEdition::ESNext,

// Explicit Resource Management
// https://github.com/tc39/proposal-explicit-resource-management
"explicit-resource-management" => SpecEdition::ESNext,

// Float16Array + Math.f16round
// https://github.com/tc39/proposal-float16array
"Float16Array" => SpecEdition::ESNext,

// Part of the next ES15 edition
"Atomics.waitAsync" => SpecEdition::ESNext,
"regexp-v-flag" => SpecEdition::ESNext,
Expand Down
3 changes: 2 additions & 1 deletion tests/tester/src/exec/js262.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ fn sleep(_: &JsValue, args: &[JsValue], context: &mut Context) -> JsResult<JsVal
/// The `$262.agent.monotonicNow()` function.
#[allow(clippy::unnecessary_wraps)]
fn monotonic_now(_: &JsValue, _: &[JsValue], _: &mut Context) -> JsResult<JsValue> {
Ok(JsValue::from(START.elapsed().as_millis() as f64))
let clock = START.get().ok_or_else(|| JsNativeError::typ().with_message("could not get the monotonic clock"))?;
Ok(JsValue::from(clock.elapsed().as_millis() as f64))
}

/// Initializes the `$262.agent` object in the main agent.
Expand Down
Loading

0 comments on commit d288422

Please sign in to comment.