mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1033253 - Null-check the result of JS_GetFunctionId. r=bz
This commit is contained in:
parent
9f0550ae71
commit
18dbac65de
6
js/xpconnect/tests/unit/test_bug1033253.js
Normal file
6
js/xpconnect/tests/unit/test_bug1033253.js
Normal file
@ -0,0 +1,6 @@
|
||||
const Cu = Components.utils;
|
||||
function run_test() {
|
||||
var sb = Cu.Sandbox('http://www.example.com');
|
||||
var f = Cu.evalInSandbox('var f = function() {}; f;', sb);
|
||||
do_check_eq(f.name, "");
|
||||
}
|
@ -43,6 +43,7 @@ support-files =
|
||||
[test_bug976151.js]
|
||||
[test_bug1001094.js]
|
||||
[test_bug1021312.js]
|
||||
[test_bug1033253.js]
|
||||
[test_bug_442086.js]
|
||||
[test_file.js]
|
||||
[test_blob.js]
|
||||
|
@ -575,8 +575,9 @@ JSXrayTraits::resolveOwnProperty(JSContext *cx, const Wrapper &jsWrapper,
|
||||
NumberValue(JS_GetFunctionArity(JS_GetObjectFunction(target))));
|
||||
return true;
|
||||
} else if (id == GetRTIdByIndex(cx, XPCJSRuntime::IDX_NAME)) {
|
||||
RootedString fname(cx, JS_GetFunctionId(JS_GetObjectFunction(target)));
|
||||
FillPropertyDescriptor(desc, wrapper, JSPROP_PERMANENT | JSPROP_READONLY,
|
||||
StringValue(JS_GetFunctionId(JS_GetObjectFunction(target))));
|
||||
fname ? StringValue(fname) : JS_GetEmptyStringValue(cx));
|
||||
} else if (id == GetRTIdByIndex(cx, XPCJSRuntime::IDX_PROTOTYPE)) {
|
||||
// Handle the 'prototype' property to make xrayedGlobal.StandardClass.prototype work.
|
||||
JSProtoKey standardConstructor = constructorFor(holder);
|
||||
|
Loading…
Reference in New Issue
Block a user