Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup tester deps and patterns #3792

Merged
merged 2 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 89 additions & 79 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_ast as ast;
pub use boa_gc as gc;
pub use boa_interner as interner;
pub use boa_parser as parser;

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 @@ -308,6 +308,18 @@ 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))
}
}

#[cfg(test)]
Expand Down
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
5 changes: 4 additions & 1 deletion tests/tester/src/exec/js262.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ 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
Loading