mirror of https://github.com/roytam1/UXP
Browse Source
Specifically, three changes: 1) valueOf should be non-enumerable. 2) valueOf should be === to Object.prototype.valueOf. 3) There should be no toJSON.pull/7/head
9 changed files with 72 additions and 24 deletions
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html> |
||||
<title>Location Symbol.toPrimitive</title> |
||||
<script src=/resources/testharness.js></script> |
||||
<script src=/resources/testharnessreport.js></script> |
||||
<div id=log></div> |
||||
<script> |
||||
test(() => { |
||||
assert_equals(location[Symbol.toPrimitive], undefined) |
||||
const prop = Object.getOwnPropertyDescriptor(location, Symbol.toPrimitive) |
||||
assert_false(prop.enumerable) |
||||
assert_false(prop.writable) |
||||
assert_false(prop.configurable) |
||||
}) |
||||
</script> |
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html> |
||||
<title>Location has no toJSON</title> |
||||
<script src=/resources/testharness.js></script> |
||||
<script src=/resources/testharnessreport.js></script> |
||||
<div id=log></div> |
||||
<script> |
||||
test(() => { |
||||
assert_equals(location.toJSON, undefined) |
||||
assert_equals(Object.getOwnPropertyDescriptor(location, "toJSON"), undefined) |
||||
assert_false(location.hasOwnProperty("toJSON")) |
||||
}) |
||||
</script> |
||||
<!-- See https://github.com/whatwg/html/pull/2294 for context. (And the HTML Standard of course.) --> |
@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html> |
||||
<title>Location valueOf</title> |
||||
<script src=/resources/testharness.js></script> |
||||
<script src=/resources/testharnessreport.js></script> |
||||
<div id=log></div> |
||||
<script> |
||||
test(() => { |
||||
assert_equals(location.valueOf, Object.prototype.valueOf) |
||||
assert_equals(typeof location.valueOf.call(5), "object") |
||||
const prop = Object.getOwnPropertyDescriptor(location, "valueOf") |
||||
assert_false(prop.enumerable) |
||||
assert_false(prop.writable) |
||||
assert_false(prop.configurable) |
||||
}) |
||||
</script> |
Loading…
Reference in new issue