mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 676936 - Rewrite InitStopIterationClass to be much clearer and simpler. r=luke
This commit is contained in:
parent
9e604da3b5
commit
65b635c946
@ -1450,10 +1450,16 @@ InitGeneratorClass(JSContext *cx, GlobalObject *global)
|
||||
static JSObject *
|
||||
InitStopIterationClass(JSContext *cx, GlobalObject *global)
|
||||
{
|
||||
JSObject *proto = js_InitClass(cx, global, NULL, &js_StopIterationClass, NULL, 0,
|
||||
NULL, NULL, NULL, NULL);
|
||||
if (proto)
|
||||
MarkStandardClassInitializedNoProto(global, &js_StopIterationClass);
|
||||
JSObject *proto = global->createBlankPrototype(cx, &js_StopIterationClass);
|
||||
if (!proto || !proto->freeze(cx))
|
||||
return NULL;
|
||||
|
||||
/* This should use a non-JSProtoKey'd slot, but this is easier for now. */
|
||||
if (!DefineConstructorAndPrototype(cx, global, JSProto_StopIteration, proto, proto))
|
||||
return NULL;
|
||||
|
||||
MarkStandardClassInitializedNoProto(global, &js_StopIterationClass);
|
||||
|
||||
return proto;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user