Convert undefined to NULL on tree entry if the tree wants an object type.

This commit is contained in:
Andreas Gal 2008-08-21 01:13:07 -07:00
parent ed7fab1440
commit 2e767b124c

View File

@ -905,6 +905,10 @@ ValueToNative(JSContext* cx, jsval v, uint8 type, double* slot)
return true;
default:
JS_ASSERT(type == JSVAL_OBJECT);
if (v == JSVAL_VOID) {
*(JSObject**)slot = NULL;
return true;
}
if (tag != JSVAL_OBJECT) {
debug_only_v(printf("object != tag%u ", tag);)
return false;