diff --git a/src/isolate.rs b/src/isolate.rs index 8e78f770b5..99e3670f24 100644 --- a/src/isolate.rs +++ b/src/isolate.rs @@ -197,7 +197,14 @@ impl Isolate { } } - pub fn execute( + /// Same as execute2() but the filename defaults to "". + pub fn execute(&self, js_source: &str) -> Result<(), JSError> { + self.execute2("", js_source) + } + + /// Executes the provided JavaScript source code. The js_filename argument is + /// provided only for debugging purposes. + pub fn execute2( &self, js_filename: &str, js_source: &str, @@ -396,7 +403,6 @@ mod tests { tokio_util::init(|| { isolate .execute( - "y.js", r#" const m = new Uint8Array([4, 5, 6]); let n = libdeno.send(m); @@ -448,7 +454,6 @@ mod tests { isolate .execute( - "y.js", r#" const control = new Uint8Array([4, 5, 6]); const data = new Uint8Array([42, 43, 44, 45, 46]); @@ -485,7 +490,6 @@ mod tests { isolate .execute( - "y.js", r#" const control = new Uint8Array([4, 5, 6]); const data = new Uint8Array([42, 43, 44, 45, 46]); diff --git a/src/main.rs b/src/main.rs index bcc18511c2..f8888feea8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -109,7 +109,7 @@ fn main() { let isolate = isolate::Isolate::new(snapshot, state, ops::dispatch); tokio_util::init(|| { isolate - .execute("deno_main.js", "denoMain();") + .execute("denoMain();") .unwrap_or_else(print_err_and_exit); isolate.event_loop().unwrap_or_else(print_err_and_exit); }); diff --git a/tests/async_error.ts.out b/tests/async_error.ts.out index dd844f9a91..8d276c7396 100644 --- a/tests/async_error.ts.out +++ b/tests/async_error.ts.out @@ -7,4 +7,4 @@ Error: error at _gatherDependencies ([WILDCARD]/js/runner.ts:[WILDCARD]) at run ([WILDCARD]/js/runner.ts:[WILDCARD]) at denoMain ([WILDCARD]/js/main.ts:[WILDCARD]) - at deno_main.js:1:1 + at :1:1 diff --git a/tests/error_001.ts.out b/tests/error_001.ts.out index b9ad7938ca..b015c60982 100644 --- a/tests/error_001.ts.out +++ b/tests/error_001.ts.out @@ -5,4 +5,4 @@ at _gatherDependencies ([WILDCARD]/js/runner.ts:[WILDCARD]) at run ([WILDCARD]/js/runner.ts:[WILDCARD]) at denoMain ([WILDCARD]/js/main.ts:[WILDCARD]) - at deno_main.js:1:1 + at :1:1 diff --git a/tests/error_002.ts.out b/tests/error_002.ts.out index 6ea4ede781..a7511b82c6 100644 --- a/tests/error_002.ts.out +++ b/tests/error_002.ts.out @@ -5,4 +5,4 @@ at _drainRunQueue ([WILDCARD]/js/runner.ts:[WILDCARD]) at run ([WILDCARD]/js/runner.ts:[WILDCARD]) at denoMain ([WILDCARD]/js/main.ts:[WILDCARD]) - at deno_main.js:1:1 + at :1:1