diff options
Diffstat (limited to 'tests/specs/run/_070_location')
-rw-r--r-- | tests/specs/run/_070_location/070_location.ts | 18 | ||||
-rw-r--r-- | tests/specs/run/_070_location/070_location.ts.out | 15 | ||||
-rw-r--r-- | tests/specs/run/_070_location/__test__.jsonc | 4 |
3 files changed, 37 insertions, 0 deletions
diff --git a/tests/specs/run/_070_location/070_location.ts b/tests/specs/run/_070_location/070_location.ts new file mode 100644 index 000000000..05e5abdf1 --- /dev/null +++ b/tests/specs/run/_070_location/070_location.ts @@ -0,0 +1,18 @@ +// deno-lint-ignore-file no-global-assign +console.log(Location); +console.log(Location.prototype); +console.log(location); +try { + location = {}; +} catch (error) { + if (error instanceof Error) { + console.log(error.toString()); + } +} +try { + location.hostname = "bar"; +} catch (error) { + if (error instanceof Error) { + console.log(error.toString()); + } +} diff --git a/tests/specs/run/_070_location/070_location.ts.out b/tests/specs/run/_070_location/070_location.ts.out new file mode 100644 index 000000000..a03cf6477 --- /dev/null +++ b/tests/specs/run/_070_location/070_location.ts.out @@ -0,0 +1,15 @@ +[class Location] +Object [Location] {} +Location { + hash: "#bat", + host: "foo", + hostname: "foo", + href: "https://foo/bar?baz#bat", + origin: "https://foo", + pathname: "/bar", + port: "", + protocol: "https:", + search: "?baz" +} +NotSupportedError: Cannot set "location". +NotSupportedError: Cannot set "location.hostname". diff --git a/tests/specs/run/_070_location/__test__.jsonc b/tests/specs/run/_070_location/__test__.jsonc new file mode 100644 index 000000000..ad92752ea --- /dev/null +++ b/tests/specs/run/_070_location/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --location https://foo/bar?baz#bat 070_location.ts", + "output": "070_location.ts.out" +} |