mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 616401 - nsHTMLCanvasElement::GetContext ignores JS exceptions; r=bz
This commit is contained in:
parent
96284cb920
commit
455a830eeb
8
content/html/content/crashtests/616401.html
Normal file
8
content/html/content/crashtests/616401.html
Normal file
@ -0,0 +1,8 @@
|
||||
<!doctype html>
|
||||
<script>
|
||||
var c = document.createElement("canvas");
|
||||
c.getContext("experimental-webgl", {
|
||||
get a() { throw 7; },
|
||||
get b() { throw 8; }
|
||||
});
|
||||
</script>
|
@ -27,6 +27,7 @@ load 602117.html
|
||||
load 613027.html
|
||||
load 614279.html
|
||||
load 614988-1.html
|
||||
load 616401.html
|
||||
load 620078-1.html
|
||||
load 620078-2.html
|
||||
load 680922-1.xul
|
||||
|
@ -526,20 +526,19 @@ nsHTMLCanvasElement::GetContext(const nsAString& aContextId,
|
||||
// this to know how to create nsISupportsStrings etc.
|
||||
|
||||
nsCOMPtr<nsIWritablePropertyBag2> contextProps;
|
||||
if (aContextOptions.isObject())
|
||||
{
|
||||
JSContext *cx = nsContentUtils::GetCurrentJSContext();
|
||||
if (aContextOptions.isObject()) {
|
||||
JSContext* cx = nsContentUtils::GetCurrentJSContext();
|
||||
|
||||
contextProps = do_CreateInstance("@mozilla.org/hash-property-bag;1");
|
||||
|
||||
JSObject *opts = &aContextOptions.toObject();
|
||||
JS::AutoIdArray props(cx, JS_Enumerate(cx, opts));
|
||||
JSObject& opts = aContextOptions.toObject();
|
||||
JS::AutoIdArray props(cx, JS_Enumerate(cx, &opts));
|
||||
for (size_t i = 0; !!props && i < props.length(); ++i) {
|
||||
jsid propid = props[i];
|
||||
jsval propname, propval;
|
||||
if (!JS_IdToValue(cx, propid, &propname) ||
|
||||
!JS_GetPropertyById(cx, opts, propid, &propval)) {
|
||||
continue;
|
||||
!JS_GetPropertyById(cx, &opts, propid, &propval)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
JSString *propnameString = JS_ValueToString(cx, propname);
|
||||
|
Loading…
Reference in New Issue
Block a user