[INFER] Overhaul handling of prototypes in type inference, bug 557407.

This commit is contained in:
Brian Hackett
2010-11-24 20:41:52 -05:00
parent 5fc44cdc9b
commit 3a36969da3
26 changed files with 976 additions and 1087 deletions

View File

@@ -1204,8 +1204,8 @@ RebaseRegsFromTo(JSFrameRegs *regs, JSStackFrame *from, JSStackFrame *to)
JS_REQUIRES_STACK JSObject *
js_NewGenerator(JSContext *cx)
{
TypeObject *objType = cx->getFixedTypeObject(TYPE_OBJECT_NEW_ITERATOR);
JSObject *obj = NewBuiltinClassInstance(cx, &js_GeneratorClass, objType);
TypeObject *type = cx->getFixedTypeObject(TYPE_OBJECT_NEW_GENERATOR);
JSObject *obj = NewBuiltinClassInstance(cx, &js_GeneratorClass, type);
if (!obj)
return NULL;
@@ -1534,9 +1534,6 @@ js_InitIteratorClasses(JSContext *cx, JSObject *obj)
if (!proto)
return NULL;
TypeObject *iterType = cx->getFixedTypeObject(TYPE_OBJECT_NEW_ITERATOR);
cx->addTypePrototype(iterType, proto->getTypeObject());
#if JS_HAS_GENERATORS
/* Initialize the generator internals if configured. */
if (!js_InitClass(cx, obj, NULL, &js_GeneratorClass, NULL, 0, NULL,