mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 705423 - ensureTypes in ArgSetter (r=billm)
--HG-- extra : rebase_source : f3c1553625a9a1a41c00cabddb2c3a6f4d267aa8
This commit is contained in:
parent
c1b02c6f63
commit
12081c2581
19
js/src/jit-test/tests/basic/testBug705423.js
Normal file
19
js/src/jit-test/tests/basic/testBug705423.js
Normal file
@ -0,0 +1,19 @@
|
||||
gczeal(1);
|
||||
|
||||
var g = newGlobal('new-compartment');
|
||||
|
||||
g.eval("\
|
||||
var f = function(x) { \
|
||||
arg = arguments; \
|
||||
fun = function() { return x }; \
|
||||
} \
|
||||
");
|
||||
|
||||
g.f(3);
|
||||
g.f = null;
|
||||
assertEq(g.fun(), 3);
|
||||
assertEq(g.arg[0], 3);
|
||||
gc();
|
||||
g.arg[0] = 9;
|
||||
assertEq(g.fun(), 9);
|
||||
assertEq(g.arg[0], 9);
|
@ -181,8 +181,11 @@ ArgSetter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, Value *vp
|
||||
unsigned arg = unsigned(JSID_TO_INT(id));
|
||||
if (arg < argsobj.initialLength() && !argsobj.isElementDeleted(arg)) {
|
||||
argsobj.setElement(arg, *vp);
|
||||
if (arg < script->function()->nargs)
|
||||
if (arg < script->function()->nargs) {
|
||||
if (!script->ensureHasTypes(cx))
|
||||
return false;
|
||||
types::TypeScript::SetArgument(cx, script, arg, *vp);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user