mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
[INFER] Set standard class slots before updating type info, bug 649439.
This commit is contained in:
parent
d8c95f63d9
commit
b42d909b23
3
js/src/jit-test/tests/basic/bug649439.js
Normal file
3
js/src/jit-test/tests/basic/bug649439.js
Normal file
@ -0,0 +1,3 @@
|
||||
var o1 = new String("abc");
|
||||
var o2 = o1[1];
|
||||
o2[1];
|
@ -1489,14 +1489,17 @@ DefineConstructorAndPrototype(JSContext *cx, JSObject *global,
|
||||
jsid id = ATOM_TO_JSID(cx->runtime->atomState.classAtoms[key]);
|
||||
JS_ASSERT(!global->nativeLookup(id));
|
||||
|
||||
if (!cx->addTypePropertyId(global->getType(), id, ObjectValue(*ctor)))
|
||||
return false;
|
||||
|
||||
if (!global->addDataProperty(cx, id, key + JSProto_LIMIT * 2, 0))
|
||||
return false;
|
||||
|
||||
/* Set these first in case addTypePropertyId looks for this class. */
|
||||
global->setSlot(key, ObjectValue(*ctor));
|
||||
global->setSlot(key + JSProto_LIMIT, ObjectValue(*proto));
|
||||
|
||||
if (!cx->addTypePropertyId(global->getType(), id, ObjectValue(*ctor)) ||
|
||||
!global->addDataProperty(cx, id, key + JSProto_LIMIT * 2, 0)) {
|
||||
global->setSlot(key, UndefinedValue());
|
||||
global->setSlot(key + JSProto_LIMIT, UndefinedValue());
|
||||
return false;
|
||||
}
|
||||
|
||||
global->setSlot(key + JSProto_LIMIT * 2, ObjectValue(*ctor));
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user