mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 768750 - Make FieldSetter always set a return value. r=bz
This commit is contained in:
parent
95382d4097
commit
7042873948
@ -35,3 +35,4 @@ asserts-if(Android,2) load 493123-1.xhtml
|
||||
load 495354-1.xhtml
|
||||
load 507628-1.xhtml
|
||||
load 507991-1.xhtml
|
||||
load set-field-bad-this.xhtml
|
||||
|
31
content/xbl/crashtests/set-field-bad-this.xhtml
Normal file
31
content/xbl/crashtests/set-field-bad-this.xhtml
Normal file
@ -0,0 +1,31 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head>
|
||||
<title>Gracefully handle setting a field on a bad |this|</title>
|
||||
|
||||
<bindings xmlns="http://www.mozilla.org/xbl">
|
||||
<binding id="a">
|
||||
<implementation>
|
||||
<field name="f">17</field>
|
||||
</implementation>
|
||||
</binding>
|
||||
</bindings>
|
||||
|
||||
<script type="application/javascript">
|
||||
window.onload = function()
|
||||
{
|
||||
var bound = document.getElementById("bound");
|
||||
try
|
||||
{
|
||||
Object.getPrototypeOf(bound).f = 42;
|
||||
}
|
||||
catch (e) { /* Throwing's fine, crashing isn't. */ }
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="bound" style="-moz-binding: url(#a)"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -262,9 +262,15 @@ FieldSetterImpl(JSContext *cx, JS::CallArgs args)
|
||||
return false;
|
||||
}
|
||||
|
||||
js::Rooted<JS::Value> v(cx,
|
||||
args.length() > 0 ? args[0] : JS::UndefinedValue());
|
||||
return JS_SetPropertyById(cx, thisObj, id, v.address());
|
||||
if (installed) {
|
||||
js::Rooted<JS::Value> v(cx,
|
||||
args.length() > 0 ? args[0] : JS::UndefinedValue());
|
||||
if (!::JS_SetPropertyById(cx, thisObj, id, v.address())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
args.rval().setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
static JSBool
|
||||
|
Loading…
Reference in New Issue
Block a user