mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-19 14:57:32 +09:00
1333045 - Update Location object properties to current spec.
Specifically, three changes: 1) valueOf should be non-enumerable. 2) valueOf should be === to Object.prototype.valueOf. 3) There should be no toJSON.
This commit is contained in:
parent
337cdbd0ce
commit
1af9026a89
9 changed files with 72 additions and 24 deletions
|
|
@ -8,4 +8,17 @@
|
|||
<div id=log></div>
|
||||
<script>
|
||||
test_stringifier_attribute(location, "href", true);
|
||||
|
||||
test(function() {
|
||||
const prop1 = Object.getOwnPropertyDescriptor(location, "toString"),
|
||||
prop2 = Object.getOwnPropertyDescriptor(location, "href")
|
||||
|
||||
assert_true(prop1.enumerable)
|
||||
assert_false(prop1.writable)
|
||||
assert_false(prop1.configurable)
|
||||
|
||||
assert_true(prop2.enumerable)
|
||||
assert_false(prop2.configurable)
|
||||
assert_equals(typeof prop2.get, "function")
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue