Test that the object has the right class, even when called from native code. bug 444233, r=shaver

This commit is contained in:
Blake Kaplan
2008-07-16 19:29:06 +02:00
parent 74e684f9ef
commit e7748e4fec
2 changed files with 96 additions and 1 deletions

View File

@@ -928,7 +928,7 @@ GetUTCTime(JSContext *cx, JSObject *obj, jsval *vp, jsdouble *dp)
{
jsval v;
if (vp && !JS_InstanceOf(cx, obj, &js_DateClass, vp + 2))
if (!JS_InstanceOf(cx, obj, &js_DateClass, vp ? vp + 2 : NULL))
return JS_FALSE;
if (!JS_GetReservedSlot(cx, obj, UTC_TIME_SLOT, &v))
return JS_FALSE;