mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 951632 - Fix shell metadata hook to skip functions from other compartments. r=luke
--HG-- extra : rebase_source : c1b5d5fdde8748890cc6179d7d0676c809c4939b
This commit is contained in:
parent
db12b3ec81
commit
b4a6c97b08
@ -1009,7 +1009,7 @@ ShellObjectMetadataCallback(JSContext *cx, JSObject **pmetadata)
|
||||
|
||||
int stackIndex = 0;
|
||||
for (NonBuiltinScriptFrameIter iter(cx); !iter.done(); ++iter) {
|
||||
if (iter.isFunctionFrame()) {
|
||||
if (iter.isFunctionFrame() && iter.compartment() == cx->compartment()) {
|
||||
if (!JS_DefinePropertyById(cx, stack, INT_TO_JSID(stackIndex), ObjectValue(*iter.callee()),
|
||||
JS_PropertyStub, JS_StrictPropertyStub, 0))
|
||||
{
|
||||
|
9
js/src/jit-test/tests/basic/bug951632.js
Normal file
9
js/src/jit-test/tests/basic/bug951632.js
Normal file
@ -0,0 +1,9 @@
|
||||
setObjectMetadataCallback(true);
|
||||
var g = newGlobal()
|
||||
g.eval("function f(a) { return h(); }");
|
||||
g.h = function () {
|
||||
return [1, 2, 3];
|
||||
};
|
||||
var o = getObjectMetadata(g.f(5));
|
||||
assertEq(o.stack.length, 1);
|
||||
assertEq(o.stack[0], g.h);
|
Loading…
Reference in New Issue
Block a user