Bug 514570 - 2 - Push |undefined| rather than |null| when calling functions without a specified |this| value, per ES5. r=jorendorff

This commit is contained in:
Jeff Walden
2010-10-12 11:50:03 -07:00
parent ed6ea5eeec
commit b8113e6d52
14 changed files with 134 additions and 93 deletions

View File

@@ -2816,12 +2816,17 @@ array_extra(JSContext *cx, ArrayExtraMode mode, uintN argc, Value *vp)
Value thisv;
if (argc > 1 && !REDUCE_MODE(mode)) {
JSObject *thisp;
if (!js_ValueToObjectOrNull(cx, argv[1], &thisp))
return JS_FALSE;
thisv.setObjectOrNull(thisp);
if (argv[1].isNullOrUndefined()) {
thisv.setUndefined();
} else {
JSObject *thisObj;
if (!js_ValueToObjectOrNull(cx, argv[1], &thisObj))
return JS_FALSE;
JS_ASSERT(thisObj);
thisv.setObject(*thisObj);
}
} else {
thisv.setNull();
thisv.setUndefined();
}
/*