[INFER] Mark unexpected undefined result for JSON.stringify, bug 642161.

This commit is contained in:
Brian Hackett 2011-03-16 19:26:49 -07:00
parent 0fe6bffa50
commit 32ed3e9e97
2 changed files with 3 additions and 0 deletions

View File

@ -0,0 +1 @@
assertEq(JSON.stringify(0 | "prefix" || Boolean), undefined);

View File

@ -162,6 +162,8 @@ js_json_stringify(JSContext *cx, uintN argc, Value *vp)
return JS_FALSE;
vp->setString(str);
} else {
if (!cx->markTypeCallerUnexpected(types::TYPE_UNDEFINED))
return JS_FALSE;
vp->setUndefined();
}