diff --git a/src/ecmascript/spidermonkey/document.c b/src/ecmascript/spidermonkey/document.c index f84d3228..51d62f7c 100644 --- a/src/ecmascript/spidermonkey/document.c +++ b/src/ecmascript/spidermonkey/document.c @@ -161,7 +161,12 @@ document_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) astring_to_jsval(ctx, vp, get_uri_string(document->uri, URI_ORIGINAL)); break; default: - INTERNAL("Invalid ID %d in document_get_property().", JSVAL_TO_INT(id)); + /* Unrecognized property ID; someone is using the + * object as an array. SMJS builtin classes (e.g. + * js_RegExpClass) just return JS_TRUE in this case + * and leave *@vp unchanged. Do the same here. + * (Actually not quite the same, as we already used + * @undef_to_jsval.) */ break; } diff --git a/src/ecmascript/spidermonkey/form.c b/src/ecmascript/spidermonkey/form.c index a4ce26e4..e5730e4f 100644 --- a/src/ecmascript/spidermonkey/form.c +++ b/src/ecmascript/spidermonkey/form.c @@ -248,7 +248,12 @@ input_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) break; default: - INTERNAL("Invalid ID %d in input_get_property().", JSVAL_TO_INT(id)); + /* Unrecognized property ID; someone is using the + * object as an array. SMJS builtin classes (e.g. + * js_RegExpClass) just return JS_TRUE in this case + * and leave *@vp unchanged. Do the same here. + * (Actually not quite the same, as we already used + * @undef_to_jsval.) */ break; } @@ -346,7 +351,10 @@ input_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) break; default: - INTERNAL("Invalid ID %d in input_set_property().", JSVAL_TO_INT(id)); + /* Unrecognized property ID; someone is using the + * object as an array. SMJS builtin classes (e.g. + * js_RegExpClass) just return JS_TRUE in this case. + * Do the same here. */ return JS_TRUE; } @@ -874,7 +882,12 @@ form_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) break; default: - INTERNAL("Invalid ID %d in form_get_property().", JSVAL_TO_INT(id)); + /* Unrecognized property ID; someone is using the + * object as an array. SMJS builtin classes (e.g. + * js_RegExpClass) just return JS_TRUE in this case + * and leave *@vp unchanged. Do the same here. + * (Actually not quite the same, as we already used + * @undef_to_jsval.) */ break; } @@ -950,7 +963,10 @@ form_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) break; default: - INTERNAL("Invalid ID %d in form_set_property().", JSVAL_TO_INT(id)); + /* Unrecognized property ID; someone is using the + * object as an array. SMJS builtin classes (e.g. + * js_RegExpClass) just return JS_TRUE in this case. + * Do the same here. */ break; } diff --git a/src/ecmascript/spidermonkey/location.c b/src/ecmascript/spidermonkey/location.c index 161a43ae..49cb74da 100644 --- a/src/ecmascript/spidermonkey/location.c +++ b/src/ecmascript/spidermonkey/location.c @@ -170,7 +170,12 @@ location_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) astring_to_jsval(ctx, vp, get_uri_string(vs->uri, URI_ORIGINAL)); break; default: - INTERNAL("Invalid ID %d in location_get_property().", JSVAL_TO_INT(id)); + /* Unrecognized property ID; someone is using the + * object as an array. SMJS builtin classes (e.g. + * js_RegExpClass) just return JS_TRUE in this case + * and leave *@vp unchanged. Do the same here. + * (Actually not quite the same, as we already used + * @undef_to_jsval.) */ break; } diff --git a/src/ecmascript/spidermonkey/navigator.c b/src/ecmascript/spidermonkey/navigator.c index aa0629a9..6c7ceab1 100644 --- a/src/ecmascript/spidermonkey/navigator.c +++ b/src/ecmascript/spidermonkey/navigator.c @@ -134,7 +134,12 @@ navigator_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) } break; default: - INTERNAL("Invalid ID %d in navigator_get_property().", JSVAL_TO_INT(id)); + /* Unrecognized property ID; someone is using the + * object as an array. SMJS builtin classes (e.g. + * js_RegExpClass) just return JS_TRUE in this case + * and leave *@vp unchanged. Do the same here. + * (Actually not quite the same, as we already used + * @undef_to_jsval.) */ break; } diff --git a/src/ecmascript/spidermonkey/unibar.c b/src/ecmascript/spidermonkey/unibar.c index 14d2570a..30ddf44c 100644 --- a/src/ecmascript/spidermonkey/unibar.c +++ b/src/ecmascript/spidermonkey/unibar.c @@ -120,7 +120,10 @@ unibar_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) #undef unibar_fetch break; default: - INTERNAL("Invalid ID %d in unibar_get_property().", JSVAL_TO_INT(id)); + /* Unrecognized property ID; someone is using the + * object as an array. SMJS builtin classes (e.g. + * js_RegExpClass) just return JS_TRUE in this case + * and leave *@vp unchanged. Do the same here. */ break; } @@ -170,7 +173,10 @@ unibar_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) register_bottom_half(update_status, NULL); break; default: - INTERNAL("Invalid ID %d in unibar_set_property().", JSVAL_TO_INT(id)); + /* Unrecognized property ID; someone is using the + * object as an array. SMJS builtin classes (e.g. + * js_RegExpClass) just return JS_TRUE in this case. + * Do the same here. */ return JS_TRUE; } diff --git a/src/ecmascript/spidermonkey/window.c b/src/ecmascript/spidermonkey/window.c index 648d7fb4..48ae0087 100644 --- a/src/ecmascript/spidermonkey/window.c +++ b/src/ecmascript/spidermonkey/window.c @@ -230,7 +230,12 @@ found_parent: break; } default: - INTERNAL("Invalid ID %d in window_get_property().", JSVAL_TO_INT(id)); + /* Unrecognized property ID; someone is using the + * object as an array. SMJS builtin classes (e.g. + * js_RegExpClass) just return JS_TRUE in this case + * and leave *@vp unchanged. Do the same here. + * (Actually not quite the same, as we already used + * @undef_to_jsval.) */ break; } @@ -270,7 +275,10 @@ window_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) switch (JSVAL_TO_INT(id)) { default: - INTERNAL("Invalid ID %d in window_set_property().", JSVAL_TO_INT(id)); + /* Unrecognized property ID; someone is using the + * object as an array. SMJS builtin classes (e.g. + * js_RegExpClass) just return JS_TRUE in this case. + * Do the same here. */ return JS_TRUE; } diff --git a/src/scripting/smjs/bookmarks.c b/src/scripting/smjs/bookmarks.c index 7411d6ce..a60d74f1 100644 --- a/src/scripting/smjs/bookmarks.c +++ b/src/scripting/smjs/bookmarks.c @@ -111,11 +111,14 @@ bookmark_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) return JS_TRUE; default: - INTERNAL("Invalid ID %d in bookmark_get_property().", - JSVAL_TO_INT(id)); + /* Unrecognized property ID; someone is using the + * object as an array. SMJS builtin classes (e.g. + * js_RegExpClass) just return JS_TRUE in this case + * and leave *@vp unchanged. Do the same here. + * (Actually not quite the same, as we already used + * @undef_to_jsval.) */ + return JS_TRUE; } - - return JS_FALSE; } /* @bookmark_class.setProperty */ @@ -155,11 +158,12 @@ bookmark_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) return JS_TRUE; } default: - INTERNAL("Invalid ID %d in bookmark_set_property().", - JSVAL_TO_INT(id)); + /* Unrecognized property ID; someone is using the + * object as an array. SMJS builtin classes (e.g. + * js_RegExpClass) just return JS_TRUE in this case. + * Do the same here. */ + return JS_TRUE; } - - return JS_FALSE; } static const JSClass bookmark_class = { diff --git a/src/scripting/smjs/cache_object.c b/src/scripting/smjs/cache_object.c index e3efa870..84279d53 100644 --- a/src/scripting/smjs/cache_object.c +++ b/src/scripting/smjs/cache_object.c @@ -86,11 +86,14 @@ cache_entry_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) return JS_TRUE; default: - INTERNAL("Invalid ID %d in cache_entry_get_property().", - JSVAL_TO_INT(id)); + /* Unrecognized property ID; someone is using the + * object as an array. SMJS builtin classes (e.g. + * js_RegExpClass) just return JS_TRUE in this case + * and leave *@vp unchanged. Do the same here. + * (Actually not quite the same, as we already used + * @undef_to_jsval.) */ + return JS_TRUE; } - - return JS_FALSE; } /* @cache_entry_class.setProperty */ @@ -140,13 +143,12 @@ cache_entry_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) return JS_TRUE; } default: - INTERNAL("Invalid ID %d in cache_entry_set_property().", - JSVAL_TO_INT(id)); + /* Unrecognized property ID; someone is using the + * object as an array. SMJS builtin classes (e.g. + * js_RegExpClass) just return JS_TRUE in this case. + * Do the same here. */ + return JS_TRUE; } - - - - return JS_FALSE; } /* @cache_entry_class.finalize */ diff --git a/src/scripting/smjs/view_state_object.c b/src/scripting/smjs/view_state_object.c index 4a5e7aa0..4ada6820 100644 --- a/src/scripting/smjs/view_state_object.c +++ b/src/scripting/smjs/view_state_object.c @@ -59,11 +59,14 @@ view_state_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) return JS_TRUE; default: - INTERNAL("Invalid ID %d in view_state_get_property().", - JSVAL_TO_INT(id)); + /* Unrecognized property ID; someone is using the + * object as an array. SMJS builtin classes (e.g. + * js_RegExpClass) just return JS_TRUE in this case + * and leave *@vp unchanged. Do the same here. + * (Actually not quite the same, as we already used + * @undef_to_jsval.) */ + return JS_TRUE; } - - return JS_FALSE; } /* @view_state_class.setProperty */ @@ -90,11 +93,12 @@ view_state_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) return JS_TRUE; } default: - INTERNAL("Invalid ID %d in view_state_set_property().", - JSVAL_TO_INT(id)); + /* Unrecognized property ID; someone is using the + * object as an array. SMJS builtin classes (e.g. + * js_RegExpClass) just return JS_TRUE in this case. + * Do the same here. */ + return JS_TRUE; } - - return JS_FALSE; } static const JSClass view_state_class = {