feat: add --location=<href> and globalThis.location (#7369)

This commit is contained in:
Nayeem Rahman 2021-01-07 18:06:08 +00:00 committed by GitHub
parent c347dfcd56
commit e61e81eb57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 737 additions and 193 deletions

View file

@ -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)