Bug 985894 - Sending a value to a newborn generator should not raise an error r=jorendorff
This commit is contained in:
@@ -1921,13 +1921,6 @@ star_generator_next(JSContext *cx, CallArgs args)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (gen->state == JSGEN_NEWBORN && args.hasDefined(0)) {
|
||||
RootedValue val(cx, args[0]);
|
||||
js_ReportValueError(cx, JSMSG_BAD_GENERATOR_SEND,
|
||||
JSDVG_SEARCH_STACK, val, js::NullPtr());
|
||||
return false;
|
||||
}
|
||||
|
||||
return SendToGenerator(cx, JSGENOP_SEND, thisObj, gen, args.get(0), StarGenerator,
|
||||
args.rval());
|
||||
}
|
||||
@@ -1956,13 +1949,6 @@ legacy_generator_next(JSContext *cx, CallArgs args)
|
||||
if (gen->state == JSGEN_CLOSED)
|
||||
return js_ThrowStopIteration(cx);
|
||||
|
||||
if (gen->state == JSGEN_NEWBORN && args.hasDefined(0)) {
|
||||
RootedValue val(cx, args[0]);
|
||||
js_ReportValueError(cx, JSMSG_BAD_GENERATOR_SEND,
|
||||
JSDVG_SEARCH_STACK, val, js::NullPtr());
|
||||
return false;
|
||||
}
|
||||
|
||||
return SendToGenerator(cx, JSGENOP_SEND, thisObj, gen, args.get(0), LegacyGenerator,
|
||||
args.rval());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user