diff --git a/js/src/jsinterp.cpp b/js/src/jsinterp.cpp index 66744d9afd60..02e642b05a0e 100644 --- a/js/src/jsinterp.cpp +++ b/js/src/jsinterp.cpp @@ -169,7 +169,13 @@ js_FillPropertyCache(JSContext *cx, JSObject *obj, jsuword kshape, tmp = obj; for (;;) { tmp = OBJ_GET_PROTO(cx, tmp); - if (!tmp) { + + /* + * We cannot cache properties coming from native objects behind + * non-native ones on the prototype chain. The non-natives can + * mutate in arbitrary way without changing any shapes. + */ + if (!tmp || !OBJ_IS_NATIVE(tmp)) { PCMETER(cache->noprotos++); *entryp = NULL; return;