mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 868805 - [LenientThis] attribute's setter should return undefined. r=bz
This commit is contained in:
parent
24b5c10e04
commit
2a03ace5c1
@ -5075,6 +5075,7 @@ class CGGenericSetter(CGAbstractBindingMethod):
|
||||
unwrapFailureCode = (
|
||||
"MOZ_ASSERT(!JS_IsExceptionPending(cx));\n"
|
||||
"ReportLenientThisUnwrappingFailure(cx, obj);\n"
|
||||
"JS_SET_RVAL(cx, vp, JS::UndefinedValue());\n"
|
||||
"return true;")
|
||||
else:
|
||||
name = "genericSetter"
|
||||
|
@ -74,6 +74,7 @@ MOCHITEST_FILES := \
|
||||
test_bug852846.html \
|
||||
test_bug862092.html \
|
||||
test_bug560072.html \
|
||||
test_lenientThis.html \
|
||||
$(NULL)
|
||||
|
||||
MOCHITEST_CHROME_FILES = \
|
||||
|
27
dom/bindings/test/test_lenientThis.html
Normal file
27
dom/bindings/test/test_lenientThis.html
Normal file
@ -0,0 +1,27 @@
|
||||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>[LenientThis]</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
function noop1() { }
|
||||
function noop2() { }
|
||||
|
||||
test(function() {
|
||||
var desc = Object.getOwnPropertyDescriptor(Document.prototype, "onreadystatechange");
|
||||
|
||||
document.onreadystatechange = noop1;
|
||||
assert_equals(document.onreadystatechange, noop1, "document.onreadystatechange == noop1");
|
||||
assert_equals(desc.get.call({ }), undefined, "document.onreadystatechange getter.call({}) == undefined");
|
||||
}, "invoking Document.onreadystatechange's getter with an invalid this object returns undefined");
|
||||
|
||||
test(function() {
|
||||
var desc = Object.getOwnPropertyDescriptor(Document.prototype, "onreadystatechange");
|
||||
|
||||
document.onreadystatechange = noop1;
|
||||
assert_equals(document.onreadystatechange, noop1, "document.onreadystatechange == noop1");
|
||||
assert_equals(desc.set.call({ }, noop2), undefined, "document.onreadystatechange setter.call({}) == undefined");
|
||||
assert_equals(document.onreadystatechange, noop1, "document.onreadystatechange == noop1 (still)");
|
||||
}, "invoking Document.onreadystatechange's setter with an invalid this object does nothing and returns undefined");
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user