diff --git a/src/ecmascript/spidermonkey/document.c b/src/ecmascript/spidermonkey/document.c index 13e647bfd..79bc700f6 100644 --- a/src/ecmascript/spidermonkey/document.c +++ b/src/ecmascript/spidermonkey/document.c @@ -164,7 +164,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 430ea2c29..659e2043d 100644 --- a/src/ecmascript/spidermonkey/form.c +++ b/src/ecmascript/spidermonkey/form.c @@ -262,7 +262,12 @@ input_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) if (fc->type == FC_SELECT) int_to_jsval(ctx, vp, fs->state); 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; } @@ -374,7 +379,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; } @@ -904,7 +912,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; } @@ -985,7 +998,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 161a43ae8..49cb74da7 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 aa0629a95..6c7ceab10 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 14d2570a0..30ddf44cf 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 8872bc667..d0f680d58 100644 --- a/src/ecmascript/spidermonkey/window.c +++ b/src/ecmascript/spidermonkey/window.c @@ -234,7 +234,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; } @@ -278,7 +283,10 @@ window_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp) print_screen_status(vs->doc_view->session); return JS_TRUE; 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 fb69930a6..3f0ca06fe 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 f621bdda4..fc3a21eb3 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/globhist.c b/src/scripting/smjs/globhist.c index 21fa1f8bc..e46c643c0 100644 --- a/src/scripting/smjs/globhist.c +++ b/src/scripting/smjs/globhist.c @@ -97,11 +97,14 @@ smjs_globhist_item_get_property(JSContext *ctx, JSObject *obj, jsval id, return JS_TRUE; default: - INTERNAL("Invalid ID %d in globhist_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; } /* @smjs_globhist_item_class.setProperty */ @@ -149,11 +152,12 @@ smjs_globhist_item_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval * 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 smjs_globhist_item_class = { diff --git a/src/scripting/smjs/view_state_object.c b/src/scripting/smjs/view_state_object.c index 3637f6c15..bc3926bb3 100644 --- a/src/scripting/smjs/view_state_object.c +++ b/src/scripting/smjs/view_state_object.c @@ -63,11 +63,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 */ @@ -94,11 +97,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 = {