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

Properly resolve paths in SimpleModuleLoader and add path to Referrer::Script #3791

Merged
merged 9 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
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@
],
"sourceLanguages": ["rust"],
"preLaunchTask": "Cargo Build boa_cli"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug Boa (Tester)",
"windows": {
"program": "${workspaceFolder}/target/debug/boa_tester.exe"
},
"program": "${workspaceFolder}/target/debug/boa_tester",
"args": ["run", "-s", "${input:testPath}", "-vvv"],
"sourceLanguages": ["rust"],
"preLaunchTask": "Cargo Build boa_tester"
Comment on lines +36 to +47
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition! :)

}
],
"inputs": [
Expand All @@ -47,6 +59,11 @@
"description": "Relative path to the module root directory",
"default": "debug",
"type": "promptString"
},
{
"id": "testPath",
"description": "Relative path to the test from the test262 directory",
"type": "promptString"
}
]
}
10 changes: 10 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
"clear": true
}
},
{
"type": "process",
"label": "Cargo Build boa_tester",
"command": "cargo",
"args": ["build", "-p", "boa_tester"],
"group": "build",
"presentation": {
"clear": true
}
},
{
"type": "process",
"label": "Run JS file",
Expand Down
34 changes: 34 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions core/engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ js = ["dep:web-time"]

[dependencies]
boa_interner.workspace = true
boa_gc = { workspace = true, features = [ "thin-vec" ] }
boa_gc = { workspace = true, features = ["thin-vec"] }
boa_profiler.workspace = true
boa_macros.workspace = true
boa_ast.workspace = true
Expand Down Expand Up @@ -106,7 +106,7 @@ time.workspace = true
hashbrown.workspace = true

# intl deps
boa_icu_provider = {workspace = true, features = ["std"], optional = true }
boa_icu_provider = { workspace = true, features = ["std"], optional = true }
sys-locale = { version = "0.3.1", optional = true }
icu_provider = { workspace = true, optional = true }
icu_locid = { workspace = true, features = ["serde"], optional = true }
Expand All @@ -116,7 +116,7 @@ icu_calendar = { workspace = true, default-features = false, optional = true }
icu_collator = { workspace = true, default-features = false, features = ["serde"], optional = true }
icu_plurals = { workspace = true, default-features = false, features = ["serde", "experimental"], optional = true }
icu_list = { workspace = true, default-features = false, features = ["serde"], optional = true }
icu_casemap = { workspace = true, default-features = false, features = ["serde"], optional = true}
icu_casemap = { workspace = true, default-features = false, features = ["serde"], optional = true }
icu_segmenter = { workspace = true, default-features = false, features = ["auto", "serde"], optional = true }
icu_decimal = { workspace = true, default-features = false, features = ["serde"], optional = true }
writeable = { workspace = true, optional = true }
Expand All @@ -137,6 +137,7 @@ float-cmp = "0.9.0"
indoc.workspace = true
textwrap.workspace = true
futures-lite = "2.3.0"
test-case = "3.3.1"

[target.x86_64-unknown-linux-gnu.dev-dependencies]
jemallocator = "0.5.4"
Expand Down
23 changes: 10 additions & 13 deletions core/engine/src/context/mod.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
//! The ECMAScript context.

mod hooks;
#[cfg(feature = "intl")]
pub(crate) mod icu;
pub mod intrinsics;
use std::{cell::Cell, path::Path, rc::Rc};

use boa_ast::StatementList;
use boa_interner::Interner;
use boa_parser::source::ReadChar;
use boa_profiler::Profiler;
pub use hooks::{DefaultHooks, HostHooks};

#[cfg(feature = "intl")]
pub use icu::IcuError;

use intrinsics::Intrinsics;

use std::{cell::Cell, path::Path, rc::Rc};

use crate::vm::RuntimeLimits;
use crate::{
builtins,
class::{Class, ClassBuilder},
Expand All @@ -30,14 +27,14 @@ use crate::{
vm::{ActiveRunnable, CallFrame, Vm},
JsNativeError, JsResult, JsString, JsValue, Source,
};
use boa_ast::StatementList;
use boa_interner::Interner;
use boa_profiler::Profiler;

use crate::vm::RuntimeLimits;

use self::intrinsics::StandardConstructor;

mod hooks;
#[cfg(feature = "intl")]
pub(crate) mod icu;
pub mod intrinsics;

thread_local! {
static CANNOT_BLOCK_COUNTER: Cell<u64> = const { Cell::new(0) };
}
Expand Down
Loading
Loading