Fix #335449:
[[DefaultValue]] operator doesn't call valueOf() for function/closure
objects when hint is not JSTYPE_STRING.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkeyDev_BRANCH@14943 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -642,8 +642,10 @@ closure_convert(JSContext *cx, JSObject *obj, JSType type, jsval *vp)
|
||||
proto = OBJ_GET_PROTO(cx, obj);
|
||||
if (proto)
|
||||
*vp = OBJECT_TO_JSVAL(proto);
|
||||
return JS_TRUE;
|
||||
}
|
||||
return JS_TRUE;
|
||||
|
||||
return js_TryValueOf(cx, obj, type, vp);
|
||||
}
|
||||
|
||||
static JSBool
|
||||
@@ -972,7 +974,8 @@ fun_convert(JSContext *cx, JSObject *obj, JSType type, jsval *vp)
|
||||
case JSTYPE_FUNCTION:
|
||||
*vp = OBJECT_TO_JSVAL(obj);
|
||||
break;
|
||||
default:;
|
||||
default:
|
||||
return js_TryValueOf(cx, obj, type, vp);
|
||||
}
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user