summaryrefslogtreecommitdiff
path: root/runtime/worker.rs
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2021-01-07 18:06:08 +0000
committerGitHub <noreply@github.com>2021-01-07 19:06:08 +0100
commite61e81eb57351782862aa50775ce4348f10b1856 (patch)
tree6099aa60857f586774a195034f18ac1fb10ca519 /runtime/worker.rs
parentc347dfcd565c3a396ae84dff46e7374851913462 (diff)
feat: add --location=<href> and globalThis.location (#7369)
Diffstat (limited to 'runtime/worker.rs')
-rw-r--r--runtime/worker.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/worker.rs b/runtime/worker.rs
index 9326d632e..6ebb2fb36 100644
--- a/runtime/worker.rs
+++ b/runtime/worker.rs
@@ -63,6 +63,7 @@ pub struct WorkerOptions {
/// Sets `Deno.noColor` in JS runtime.
pub no_color: bool,
pub get_error_class_fn: Option<GetErrorClassFn>,
+ pub location: Option<Url>,
}
impl MainWorker {
@@ -179,6 +180,7 @@ impl MainWorker {
"tsVersion": options.ts_version,
"unstableFlag": options.unstable,
"v8Version": deno_core::v8_version(),
+ "location": options.location,
});
let script = format!(
@@ -282,6 +284,7 @@ mod tests {
ts_version: "x".to_string(),
no_color: true,
get_error_class_fn: None,
+ location: None,
};
MainWorker::from_options(main_module, permissions, &options)