mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
fix(ext/web): set location undefined when --location
is not specified (#13046)
This commit is contained in:
parent
a2b4d13540
commit
308813ae29
3 changed files with 3 additions and 10 deletions
|
@ -233,7 +233,6 @@ itest!(_070_location {
|
||||||
itest!(_071_location_unset {
|
itest!(_071_location_unset {
|
||||||
args: "run 071_location_unset.ts",
|
args: "run 071_location_unset.ts",
|
||||||
output: "071_location_unset.ts.out",
|
output: "071_location_unset.ts.out",
|
||||||
exit_code: 1,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(_072_location_relative_fetch {
|
itest!(_072_location_relative_fetch {
|
||||||
|
|
2
cli/tests/testdata/071_location_unset.ts.out
vendored
2
cli/tests/testdata/071_location_unset.ts.out
vendored
|
@ -1,4 +1,4 @@
|
||||||
[WILDCARD][Function: Location]
|
[WILDCARD][Function: Location]
|
||||||
Location {}
|
Location {}
|
||||||
error: Uncaught ReferenceError: Access to "location", run again with --location <href>.
|
undefined
|
||||||
[WILDCARD]
|
[WILDCARD]
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
const {
|
const {
|
||||||
Error,
|
Error,
|
||||||
ObjectDefineProperties,
|
ObjectDefineProperties,
|
||||||
ReferenceError,
|
|
||||||
Symbol,
|
Symbol,
|
||||||
SymbolFor,
|
SymbolFor,
|
||||||
SymbolToStringTag,
|
SymbolToStringTag,
|
||||||
|
@ -356,8 +355,8 @@
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
let location = null;
|
let location = undefined;
|
||||||
let workerLocation = null;
|
let workerLocation = undefined;
|
||||||
|
|
||||||
function setLocationHref(href) {
|
function setLocationHref(href) {
|
||||||
location = new Location(href, locationConstructorKey);
|
location = new Location(href, locationConstructorKey);
|
||||||
|
@ -377,11 +376,6 @@
|
||||||
},
|
},
|
||||||
locationDescriptor: {
|
locationDescriptor: {
|
||||||
get() {
|
get() {
|
||||||
if (location == null) {
|
|
||||||
throw new ReferenceError(
|
|
||||||
`Access to "location", run again with --location <href>.`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return location;
|
return location;
|
||||||
},
|
},
|
||||||
set() {
|
set() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue