Skip to content

Commit

Permalink
Fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 committed Oct 15, 2023
1 parent 90cc028 commit 88874ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion boa_engine/src/module/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl Module {
// Concrete method [`LoadRequestedModules ( [ hostDefined ] )`][spec].
//
// [spec]: https://tc39.es/ecma262/#sec-LoadRequestedModules
// TODO: 1. If hostDefined is not present, let hostDefined be empty.
// 1. If hostDefined is not present, let hostDefined be empty.

// 2. Let pc be ! NewPromiseCapability(%Promise%).
let pc = PromiseCapability::new(
Expand Down
6 changes: 3 additions & 3 deletions boa_examples/src/bin/synthetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn main() -> Result<(), Box<dyn Error>> {
"#;

// This can be overriden with any custom implementation of `ModuleLoader`.
let loader = &SimpleModuleLoader::new("./boa_examples/scripts/modules")?;
let loader = &SimpleModuleLoader::new("./scripts/modules")?;
let dyn_loader: &dyn ModuleLoader = loader;

// Just need to cast to a `ModuleLoader` before passing it to the builder.
Expand All @@ -33,7 +33,7 @@ fn main() -> Result<(), Box<dyn Error>> {
// Now, create the synthetic module and insert it into the loader.
let operations = create_operations_module(context);
loader.insert(
PathBuf::from("./boa_examples/scripts/modules")
PathBuf::from("./scripts/modules")
.canonicalize()?
.join("operations.mjs"),
operations,
Expand All @@ -50,7 +50,7 @@ fn main() -> Result<(), Box<dyn Error>> {
// Simulate as if the "fake" module is located in the modules root, just to ensure that
// the loader won't double load in case someone tries to import "./main.mjs".
loader.insert(
Path::new("./boa_examples/scripts/modules")
Path::new("./scripts/modules")
.canonicalize()?
.join("main.mjs"),
module.clone(),
Expand Down

0 comments on commit 88874ae

Please sign in to comment.