Add CallArgs::hasDefined convenience method. Bug 730676, r=luke.

This commit is contained in:
Jason Orendorff
2012-03-01 12:48:52 -06:00
parent a3b5f66ae9
commit 0d99c649c3
9 changed files with 47 additions and 45 deletions

View File

@@ -1647,7 +1647,7 @@ generator_op(JSContext *cx, Native native, JSGeneratorOp op, Value *vp, unsigned
break;
case JSGENOP_SEND:
if (args.length() >= 1 && !args[0].isUndefined()) {
if (args.hasDefined(0)) {
js_ReportValueError(cx, JSMSG_BAD_GENERATOR_SEND,
JSDVG_SEARCH_STACK, args[0], NULL);
return false;