Followup fix for iteration over null, misread a caller and thus missed that we could be asked to snapshot properties of null. r=orange

This commit is contained in:
Jeff Walden
2010-06-17 14:45:55 -07:00
parent 2f6bb17060
commit fa441b20c0

View File

@@ -491,8 +491,9 @@ GetIterator(JSContext *cx, JSObject *obj, uintN flags, jsval *vp)
/* Store in *vp to protect it from GC (callers must root vp). */
*vp = OBJECT_TO_JSVAL(iterobj);
/* NB: for (var p in null) succeeds by iterating over no properties. */
AutoValueVector props(cx);
if (!Snapshot(cx, obj, flags, props))
if (JS_LIKELY(obj) && !Snapshot(cx, obj, flags, props))
return false;
NativeIterator *ni =