Bug 985894 - Sending a value to a newborn generator should not raise an error r=jorendorff

This commit is contained in:
Andy Wingo
2014-06-26 15:32:30 +02:00
parent 0cd3f18d30
commit d5668d517d
3 changed files with 5 additions and 26 deletions

View File

@@ -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());
}