diff --git a/src/ecmascript/spidermonkey/document.c b/src/ecmascript/spidermonkey/document.c index fe73963a..f9b2c77b 100644 --- a/src/ecmascript/spidermonkey/document.c +++ b/src/ecmascript/spidermonkey/document.c @@ -144,6 +144,9 @@ document_get_property_baseURI(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -152,17 +155,27 @@ document_get_property_baseURI(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &document_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &document_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } char *str = get_uri_string(vs->uri, URI_BASE); if (!str) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -240,6 +253,9 @@ document_get_property_cookie(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -251,6 +267,9 @@ document_get_property_cookie(JSContext *ctx, unsigned int argc, JS::Value *vp) vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } cookies = send_cookies_js(vs->uri); @@ -280,6 +299,9 @@ document_set_property_cookie(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -290,6 +312,9 @@ document_set_property_cookie(JSContext *ctx, unsigned int argc, JS::Value *vp) vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } char *text = jsval_to_string(ctx, args[0]); @@ -434,6 +459,9 @@ document_get_property_documentURI(JSContext *ctx, unsigned int argc, JS::Value * JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -442,8 +470,12 @@ document_get_property_documentURI(JSContext *ctx, unsigned int argc, JS::Value * /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &document_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &document_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { @@ -453,6 +485,9 @@ document_get_property_documentURI(JSContext *ctx, unsigned int argc, JS::Value * char *str = get_uri_string(vs->uri, URI_BASE); if (!str) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -475,6 +510,9 @@ document_get_property_domain(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -483,17 +521,27 @@ document_get_property_domain(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &document_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &document_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } char *str = get_uri_string(vs->uri, URI_HOST); if (!str) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -699,6 +747,9 @@ document_get_property_location(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); @@ -719,6 +770,9 @@ document_get_property_nodeType(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } args.rval().setInt32(9); @@ -739,6 +793,9 @@ document_set_property_location(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -750,6 +807,9 @@ document_set_property_location(JSContext *ctx, unsigned int argc, JS::Value *vp) vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; @@ -776,6 +836,9 @@ document_get_property_referrer(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -789,6 +852,9 @@ document_get_property_referrer(JSContext *ctx, unsigned int argc, JS::Value *vp) vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; @@ -893,6 +959,9 @@ document_get_property_title(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -904,6 +973,9 @@ document_get_property_title(JSContext *ctx, unsigned int argc, JS::Value *vp) vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; @@ -925,6 +997,9 @@ document_set_property_title(JSContext *ctx, int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -939,6 +1014,9 @@ document_set_property_title(JSContext *ctx, int argc, JS::Value *vp) vs = interpreter->vs; if (!vs || !vs->doc_view) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; @@ -960,6 +1038,9 @@ document_get_property_url(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -972,6 +1053,9 @@ document_get_property_url(JSContext *ctx, unsigned int argc, JS::Value *vp) vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; @@ -1000,6 +1084,9 @@ document_set_property_url(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1010,6 +1097,9 @@ document_set_property_url(JSContext *ctx, unsigned int argc, JS::Value *vp) vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; @@ -1094,6 +1184,9 @@ document_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, J JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1101,8 +1194,12 @@ document_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, J JSClass* classPtr = JS_GetClass(hobj); - if (classPtr != &document_class) + if (classPtr != &document_class) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; doc_view = vs->doc_view; @@ -1145,6 +1242,9 @@ document_write_do(JSContext *ctx, unsigned int argc, JS::Value *rval, int newlin JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1751,6 +1851,9 @@ doctype_get_property_name(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1759,8 +1862,12 @@ doctype_get_property_name(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &doctype_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &doctype_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } xmlpp::Dtd *dtd = JS_GetPrivate(hobj); @@ -1786,6 +1893,9 @@ doctype_get_property_publicId(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1794,8 +1904,12 @@ doctype_get_property_publicId(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &doctype_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &doctype_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } xmlpp::Dtd *dtd = JS_GetPrivate(hobj); @@ -1821,6 +1935,9 @@ doctype_get_property_systemId(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1829,8 +1946,12 @@ doctype_get_property_systemId(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &doctype_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &doctype_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } xmlpp::Dtd *dtd = JS_GetPrivate(hobj); diff --git a/src/ecmascript/spidermonkey/element.c b/src/ecmascript/spidermonkey/element.c index e43cd8a1..a3f8f9ed 100644 --- a/src/ecmascript/spidermonkey/element.c +++ b/src/ecmascript/spidermonkey/element.c @@ -158,6 +158,9 @@ element_get_property_attributes(JSContext *ctx, unsigned int argc, JS::Value *vp JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -166,11 +169,18 @@ element_get_property_attributes(JSContext *ctx, unsigned int argc, JS::Value *vp /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -208,6 +218,9 @@ element_get_property_children(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -216,11 +229,18 @@ element_get_property_children(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -274,6 +294,9 @@ element_get_property_childElementCount(JSContext *ctx, unsigned int argc, JS::Va JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -282,11 +305,18 @@ element_get_property_childElementCount(JSContext *ctx, unsigned int argc, JS::Va /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -315,6 +345,9 @@ element_get_property_childNodes(JSContext *ctx, unsigned int argc, JS::Value *vp JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -323,11 +356,18 @@ element_get_property_childNodes(JSContext *ctx, unsigned int argc, JS::Value *vp /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -366,6 +406,9 @@ element_get_property_className(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -374,11 +417,18 @@ element_get_property_className(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -409,6 +459,9 @@ element_get_property_dir(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -417,11 +470,18 @@ element_get_property_dir(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -455,6 +515,9 @@ element_get_property_firstChild(JSContext *ctx, unsigned int argc, JS::Value *vp JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -463,11 +526,18 @@ element_get_property_firstChild(JSContext *ctx, unsigned int argc, JS::Value *vp /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -504,6 +574,9 @@ element_get_property_firstElementChild(JSContext *ctx, unsigned int argc, JS::Va JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -512,11 +585,18 @@ element_get_property_firstElementChild(JSContext *ctx, unsigned int argc, JS::Va /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -562,6 +642,9 @@ element_get_property_id(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -570,11 +653,18 @@ element_get_property_id(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -604,6 +694,9 @@ element_get_property_lang(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -612,11 +705,18 @@ element_get_property_lang(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -646,6 +746,9 @@ element_get_property_lastChild(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -654,11 +757,18 @@ element_get_property_lastChild(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -694,6 +804,9 @@ element_get_property_lastElementChild(JSContext *ctx, unsigned int argc, JS::Val JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -702,11 +815,18 @@ element_get_property_lastElementChild(JSContext *ctx, unsigned int argc, JS::Val /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -752,6 +872,9 @@ element_get_property_nextElementSibling(JSContext *ctx, unsigned int argc, JS::V JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -760,11 +883,18 @@ element_get_property_nextElementSibling(JSContext *ctx, unsigned int argc, JS::V /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -810,6 +940,9 @@ element_get_property_nodeName(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -818,11 +951,18 @@ element_get_property_nodeName(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -868,6 +1008,9 @@ element_get_property_nodeType(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -876,11 +1019,18 @@ element_get_property_nodeType(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -920,6 +1070,9 @@ element_get_property_nodeValue(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -928,11 +1081,18 @@ element_get_property_nodeValue(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -989,6 +1149,9 @@ element_get_property_nextSibling(JSContext *ctx, unsigned int argc, JS::Value *v JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -997,11 +1160,18 @@ element_get_property_nextSibling(JSContext *ctx, unsigned int argc, JS::Value *v /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1038,6 +1208,9 @@ element_get_property_ownerDocument(JSContext *ctx, unsigned int argc, JS::Value JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1046,11 +1219,18 @@ element_get_property_ownerDocument(JSContext *ctx, unsigned int argc, JS::Value /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } args.rval().setObject(*(JSObject *)(interpreter->document_obj)); @@ -1071,6 +1251,9 @@ element_get_property_parentElement(JSContext *ctx, unsigned int argc, JS::Value JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1079,11 +1262,18 @@ element_get_property_parentElement(JSContext *ctx, unsigned int argc, JS::Value /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1120,6 +1310,9 @@ element_get_property_parentNode(JSContext *ctx, unsigned int argc, JS::Value *vp JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1128,11 +1321,18 @@ element_get_property_parentNode(JSContext *ctx, unsigned int argc, JS::Value *vp /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1169,6 +1369,9 @@ element_get_property_previousElementSibling(JSContext *ctx, unsigned int argc, J JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1177,11 +1380,18 @@ element_get_property_previousElementSibling(JSContext *ctx, unsigned int argc, J /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1227,6 +1437,9 @@ element_get_property_previousSibling(JSContext *ctx, unsigned int argc, JS::Valu JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1235,11 +1448,18 @@ element_get_property_previousSibling(JSContext *ctx, unsigned int argc, JS::Valu /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1276,6 +1496,9 @@ element_get_property_tagName(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1284,11 +1507,18 @@ element_get_property_tagName(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1319,6 +1549,9 @@ element_get_property_title(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1327,11 +1560,18 @@ element_get_property_title(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1446,6 +1686,9 @@ element_get_property_innerHtml(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1454,11 +1697,18 @@ element_get_property_innerHtml(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1491,6 +1741,9 @@ element_get_property_outerHtml(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1499,11 +1752,18 @@ element_get_property_outerHtml(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1536,6 +1796,9 @@ element_get_property_textContent(JSContext *ctx, unsigned int argc, JS::Value *v JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1544,11 +1807,18 @@ element_get_property_textContent(JSContext *ctx, unsigned int argc, JS::Value *v /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } xmlpp::Element *el = JS_GetPrivate(hobj); @@ -1581,6 +1851,9 @@ element_set_property_className(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1589,8 +1862,12 @@ element_set_property_className(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } struct view_state *vs = interpreter->vs; if (!vs) { @@ -1623,6 +1900,9 @@ element_set_property_dir(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1631,8 +1911,12 @@ element_set_property_dir(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } struct view_state *vs = interpreter->vs; if (!vs) { @@ -1669,6 +1953,9 @@ element_set_property_id(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1677,8 +1964,12 @@ element_set_property_id(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } struct view_state *vs = interpreter->vs; if (!vs) { @@ -1712,6 +2003,9 @@ element_set_property_innerHtml(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1720,8 +2014,12 @@ element_set_property_innerHtml(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } struct view_state *vs = interpreter->vs; if (!vs) { @@ -1776,6 +2074,9 @@ element_set_property_innerText(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1784,8 +2085,12 @@ element_set_property_innerText(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } struct view_state *vs = interpreter->vs; if (!vs) { @@ -1824,6 +2129,9 @@ element_set_property_lang(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1832,8 +2140,12 @@ element_set_property_lang(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } struct view_state *vs = interpreter->vs; if (!vs) { @@ -1867,6 +2179,9 @@ element_set_property_outerHtml(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1875,8 +2190,12 @@ element_set_property_outerHtml(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } struct view_state *vs = interpreter->vs; if (!vs) { @@ -1898,6 +2217,9 @@ element_set_property_textContent(JSContext *ctx, unsigned int argc, JS::Value *v JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1906,8 +2228,12 @@ element_set_property_textContent(JSContext *ctx, unsigned int argc, JS::Value *v /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } struct view_state *vs = interpreter->vs; if (!vs) { @@ -1930,6 +2256,9 @@ element_set_property_title(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1938,8 +2267,12 @@ element_set_property_title(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } struct view_state *vs = interpreter->vs; if (!vs) { @@ -2032,6 +2365,9 @@ element_appendChild(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp || argc != 1) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2041,6 +2377,9 @@ element_appendChild(JSContext *ctx, unsigned int argc, JS::Value *rval) struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2069,6 +2408,9 @@ element_contains(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp || argc != 1) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2077,8 +2419,12 @@ element_contains(JSContext *ctx, unsigned int argc, JS::Value *rval) struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } xmlpp::Element *el = JS_GetPrivate(hobj); @@ -2114,6 +2460,9 @@ element_getAttribute(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp || argc != 1) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2122,8 +2471,12 @@ element_getAttribute(JSContext *ctx, unsigned int argc, JS::Value *rval) struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } xmlpp::Element *el = JS_GetPrivate(hobj); @@ -2160,6 +2513,9 @@ element_getAttributeNode(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp || argc != 1) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2168,8 +2524,12 @@ element_getAttributeNode(JSContext *ctx, unsigned int argc, JS::Value *rval) struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } xmlpp::Element *el = JS_GetPrivate(hobj); @@ -2197,6 +2557,9 @@ element_hasAttribute(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp || argc != 1) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2205,8 +2568,12 @@ element_hasAttribute(JSContext *ctx, unsigned int argc, JS::Value *rval) struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } xmlpp::Element *el = JS_GetPrivate(hobj); @@ -2233,6 +2600,9 @@ element_hasAttributes(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp || argc != 0) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2264,6 +2634,9 @@ element_hasChildNodes(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp || argc != 0) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2295,6 +2668,9 @@ element_insertBefore(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp || argc != 2) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2342,6 +2718,9 @@ element_isEqualNode(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp || argc != 1) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2350,8 +2729,12 @@ element_isEqualNode(JSContext *ctx, unsigned int argc, JS::Value *rval) struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } xmlpp::Element *el = JS_GetPrivate(hobj); @@ -2390,6 +2773,9 @@ element_isSameNode(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp || argc != 1) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2398,8 +2784,12 @@ element_isSameNode(JSContext *ctx, unsigned int argc, JS::Value *rval) struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } xmlpp::Element *el = JS_GetPrivate(hobj); @@ -2425,6 +2815,9 @@ element_remove(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp || argc != 0) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2433,8 +2826,12 @@ element_remove(JSContext *ctx, unsigned int argc, JS::Value *rval) struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } xmlpp::Element *el = JS_GetPrivate(hobj); @@ -2457,6 +2854,9 @@ element_setAttribute(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp || argc != 2) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2465,8 +2865,12 @@ element_setAttribute(JSContext *ctx, unsigned int argc, JS::Value *rval) struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &element_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } xmlpp::Element *el = JS_GetPrivate(hobj); @@ -2559,6 +2963,9 @@ htmlCollection_get_property_length(JSContext *ctx, unsigned int argc, JS::Value JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2567,11 +2974,18 @@ htmlCollection_get_property_length(JSContext *ctx, unsigned int argc, JS::Value /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &htmlCollection_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &htmlCollection_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2635,12 +3049,20 @@ htmlCollection_item2(JSContext *ctx, JS::HandleObject hobj, int index, JS::Mutab JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &htmlCollection_class, NULL)) return false; + if (!JS_InstanceOf(ctx, hobj, &htmlCollection_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; + } hvp.setUndefined(); @@ -2675,13 +3097,20 @@ htmlCollection_namedItem2(JSContext *ctx, JS::HandleObject hobj, char *str, JS:: JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &htmlCollection_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &htmlCollection_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } xmlpp::Node::NodeSet *ns = JS_GetPrivate(hobj); @@ -2725,6 +3154,9 @@ htmlCollection_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2734,6 +3166,9 @@ htmlCollection_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId * appropriate class but has one in its prototype chain. Fail * such calls. */ if (!JS_InstanceOf(ctx, hobj, &htmlCollection_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2836,6 +3271,9 @@ nodeList_get_property_length(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2844,11 +3282,18 @@ nodeList_get_property_length(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &nodeList_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &nodeList_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2890,12 +3335,20 @@ nodeList_item2(JSContext *ctx, JS::HandleObject hobj, int index, JS::MutableHand JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &nodeList_class, NULL)) return false; + if (!JS_InstanceOf(ctx, hobj, &nodeList_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; + } hvp.setUndefined(); @@ -2939,6 +3392,9 @@ nodeList_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, J JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2948,6 +3404,9 @@ nodeList_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, J * appropriate class but has one in its prototype chain. Fail * such calls. */ if (!JS_InstanceOf(ctx, hobj, &nodeList_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -3035,6 +3494,9 @@ attributes_get_property_length(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -3043,11 +3505,18 @@ attributes_get_property_length(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &attributes_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &attributes_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -3110,12 +3579,20 @@ attributes_item2(JSContext *ctx, JS::HandleObject hobj, int index, JS::MutableHa JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &attributes_class, NULL)) return false; + if (!JS_InstanceOf(ctx, hobj, &attributes_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; + } hvp.setUndefined(); @@ -3151,13 +3628,20 @@ attributes_namedItem2(JSContext *ctx, JS::HandleObject hobj, char *str, JS::Muta JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &attributes_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &attributes_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } xmlpp::Element::AttributeList *al = JS_GetPrivate(hobj); @@ -3202,6 +3686,9 @@ attributes_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -3211,6 +3698,9 @@ attributes_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, * appropriate class but has one in its prototype chain. Fail * such calls. */ if (!JS_InstanceOf(ctx, hobj, &attributes_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -3295,6 +3785,9 @@ attr_get_property_name(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -3303,11 +3796,18 @@ attr_get_property_name(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &attr_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &attr_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -3337,6 +3837,9 @@ attr_get_property_value(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -3345,11 +3848,18 @@ attr_get_property_value(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &attr_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &attr_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } diff --git a/src/ecmascript/spidermonkey/form.c b/src/ecmascript/spidermonkey/form.c index e290adbb..a53f91a6 100644 --- a/src/ecmascript/spidermonkey/form.c +++ b/src/ecmascript/spidermonkey/form.c @@ -167,6 +167,9 @@ input_get_property_accessKey(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -175,12 +178,20 @@ input_get_property_accessKey(JSContext *ctx, unsigned int argc, JS::Value *vp) vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -202,8 +213,12 @@ input_get_property_accessKey(JSContext *ctx, unsigned int argc, JS::Value *vp) if (keystr) { args.rval().setString(keystr); } - else + else { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } } return true; } @@ -228,6 +243,9 @@ input_set_property_accessKey(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -235,12 +253,20 @@ input_set_property_accessKey(JSContext *ctx, unsigned int argc, JS::Value *vp) vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -258,6 +284,9 @@ input_set_property_accessKey(JSContext *ctx, unsigned int argc, JS::Value *vp) accesskey = UCS_NO_CHAR; if (!args[0].isString()) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } JSString *str = args[0].toString(); @@ -281,6 +310,9 @@ input_set_property_accessKey(JSContext *ctx, unsigned int argc, JS::Value *vp) } if (accesskey == UCS_NO_CHAR) { JS_ReportErrorUTF8(ctx, "Invalid UTF-16 sequence"); +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -308,6 +340,9 @@ input_get_property_alt(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -316,12 +351,20 @@ input_get_property_alt(JSContext *ctx, unsigned int argc, JS::Value *vp) vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -348,6 +391,9 @@ input_set_property_alt(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -355,12 +401,20 @@ input_set_property_alt(JSContext *ctx, unsigned int argc, JS::Value *vp) vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -383,7 +437,12 @@ input_get_property_checked(JSContext *ctx, unsigned int argc, JS::Value *vp) struct form_state *fs; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } args.rval().setBoolean(fs->state); @@ -407,6 +466,9 @@ input_set_property_checked(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -415,12 +477,20 @@ input_set_property_checked(JSContext *ctx, unsigned int argc, JS::Value *vp) vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -450,6 +520,9 @@ input_get_property_defaultChecked(JSContext *ctx, unsigned int argc, JS::Value * JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -457,12 +530,20 @@ input_get_property_defaultChecked(JSContext *ctx, unsigned int argc, JS::Value * vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -490,6 +571,9 @@ input_get_property_defaultValue(JSContext *ctx, unsigned int argc, JS::Value *vp JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -497,12 +581,17 @@ input_get_property_defaultValue(JSContext *ctx, unsigned int argc, JS::Value *vp vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -531,6 +620,9 @@ input_get_property_disabled(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -538,12 +630,20 @@ input_get_property_disabled(JSContext *ctx, unsigned int argc, JS::Value *vp) vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -572,6 +672,9 @@ input_set_property_disabled(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -579,12 +682,20 @@ input_set_property_disabled(JSContext *ctx, unsigned int argc, JS::Value *vp) vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -609,7 +720,12 @@ input_get_property_form(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::RootedObject parent_form(ctx, JS::GetNonCCWObjectGlobal(hobj)); assert(JS_InstanceOf(ctx, parent_form, &form_class, NULL)); - if_assert_failed return false; + if_assert_failed { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; + } args.rval().setObject(*parent_form); @@ -633,6 +749,9 @@ input_get_property_maxLength(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -640,12 +759,20 @@ input_get_property_maxLength(JSContext *ctx, unsigned int argc, JS::Value *vp) vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -673,6 +800,9 @@ input_set_property_maxLength(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -680,12 +810,20 @@ input_set_property_maxLength(JSContext *ctx, unsigned int argc, JS::Value *vp) vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -713,6 +851,9 @@ input_get_property_name(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -720,12 +861,20 @@ input_get_property_name(JSContext *ctx, unsigned int argc, JS::Value *vp) vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -754,6 +903,9 @@ input_set_property_name(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -763,18 +915,27 @@ input_set_property_name(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -802,6 +963,9 @@ input_get_property_readonly(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -810,17 +974,29 @@ input_get_property_readonly(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -850,6 +1026,9 @@ input_set_property_readonly(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -858,17 +1037,29 @@ input_set_property_readonly(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -899,6 +1090,9 @@ input_get_property_selectedIndex(JSContext *ctx, unsigned int argc, JS::Value *v JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -907,17 +1101,29 @@ input_get_property_selectedIndex(JSContext *ctx, unsigned int argc, JS::Value *v /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -951,6 +1157,9 @@ input_set_property_selectedIndex(JSContext *ctx, unsigned int argc, JS::Value *v JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -959,17 +1168,29 @@ input_set_property_selectedIndex(JSContext *ctx, unsigned int argc, JS::Value *v /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -1004,6 +1225,9 @@ input_get_property_size(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1012,17 +1236,29 @@ input_get_property_size(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -1052,6 +1288,9 @@ input_get_property_src(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1060,17 +1299,29 @@ input_get_property_src(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -1107,6 +1358,9 @@ input_set_property_src(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1115,8 +1369,12 @@ input_set_property_src(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { @@ -1125,7 +1383,12 @@ input_set_property_src(JSContext *ctx, unsigned int argc, JS::Value *vp) doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -1161,6 +1424,9 @@ input_get_property_tabIndex(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1169,17 +1435,29 @@ input_get_property_tabIndex(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -1217,6 +1495,9 @@ input_get_property_type(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1225,17 +1506,29 @@ input_get_property_type(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -1273,11 +1566,20 @@ input_get_property_value(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } args.rval().setString(JS_NewStringCopyZ(ctx, fs->value)); @@ -1301,6 +1603,9 @@ input_set_property_value(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1309,17 +1614,29 @@ input_set_property_value(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; document = doc_view->document; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } fc = find_form_control(document, fs); assert(fc); @@ -1411,8 +1728,12 @@ input_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS:: /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } hvp.setUndefined(); @@ -1443,8 +1764,12 @@ input_set_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS:: /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &input_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } return true; } @@ -1483,19 +1808,32 @@ input_click(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &input_class, &args)) return false; + if (!JS_InstanceOf(ctx, hobj, &input_class, &args)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; + } vs = interpreter->vs; doc_view = vs->doc_view; document = doc_view->document; ses = doc_view->session; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } assert(fs); fc = find_form_control(document, fs); @@ -1541,19 +1879,32 @@ input_focus(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &input_class, &args)) return false; + if (!JS_InstanceOf(ctx, hobj, &input_class, &args)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; + } vs = interpreter->vs; doc_view = vs->doc_view; document = doc_view->document; ses = doc_view->session; fs = input_get_form_state(ctx, hobj); - if (!fs) return false; /* detached */ + if (!fs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } assert(fs); fc = find_form_control(document, fs); @@ -1787,6 +2138,9 @@ form_elements_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId h JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1796,6 +2150,9 @@ form_elements_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId h * appropriate class but has one in its prototype chain. Fail * such calls. */ if (!JS_InstanceOf(ctx, hobj, &form_elements_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } vs = interpreter->vs; @@ -1804,7 +2161,12 @@ form_elements_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId h form_view = JS_GetInstancePrivate(ctx, hobj, &form_elements_class, nullptr); // form_view = form_get_form_view(ctx, nullptr, /*parent_form*/ NULL); - if (!form_view) return false; /* detached */ + if (!form_view) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } form = find_form_by_form_view(document, form_view); if (JSID_IS_STRING(id)) { @@ -1865,6 +2227,9 @@ form_elements_get_property_length(JSContext *ctx, unsigned int argc, JS::Value * JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1873,6 +2238,9 @@ form_elements_get_property_length(JSContext *ctx, unsigned int argc, JS::Value * vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -1880,7 +2248,12 @@ form_elements_get_property_length(JSContext *ctx, unsigned int argc, JS::Value * document = doc_view->document; form_view = JS_GetInstancePrivate(ctx, hobj, &form_elements_class, nullptr); // form_view = form_get_form_view(ctx, nullptr, /*parent_form*/ NULL); - if (!form_view) return false; /* detached */ + if (!form_view) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } form = find_form_by_form_view(document, form_view); args.rval().setInt32(list_size(&form->items)); @@ -1927,12 +2300,20 @@ form_elements_item2(JSContext *ctx, JS::HandleObject hobj, int index, JS::Mutabl JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &form_elements_class, NULL)) return false; + if (!JS_InstanceOf(ctx, hobj, &form_elements_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; + } vs = interpreter->vs; doc_view = vs->doc_view; @@ -1942,7 +2323,12 @@ form_elements_item2(JSContext *ctx, JS::HandleObject hobj, int index, JS::Mutabl // form_view = form_get_form_view(ctx, nullptr/*parent_form*/, NULL); - if (!form_view) return false; /* detached */ + if (!form_view) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } form = find_form_by_form_view(document, form_view); hvp.setUndefined(); @@ -2003,6 +2389,9 @@ form_elements_namedItem2(JSContext *ctx, JS::HandleObject hobj, char *string, JS JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2012,7 +2401,12 @@ form_elements_namedItem2(JSContext *ctx, JS::HandleObject hobj, char *string, JS return true; } - if (!JS_InstanceOf(ctx, hobj, &form_elements_class, NULL)) return false; + if (!JS_InstanceOf(ctx, hobj, &form_elements_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; + } vs = interpreter->vs; doc_view = vs->doc_view; @@ -2020,7 +2414,12 @@ form_elements_namedItem2(JSContext *ctx, JS::HandleObject hobj, char *string, JS form_view = JS_GetInstancePrivate(ctx, hobj, &form_elements_class, nullptr); // form_view = form_get_form_view(ctx, nullptr, /*parent_form*/ NULL); - if (!form_view) return false; /* detached */ + if (!form_view) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } form = find_form_by_form_view(document, form_view); hvp.setUndefined(); @@ -2116,6 +2515,9 @@ form_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::M JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2124,13 +2526,22 @@ form_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::M /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; doc_view = vs->doc_view; fv = form_get_form_view(ctx, hobj, NULL); - if (!fv) return false; /* detached */ + if (!fv) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } form = find_form_by_form_view(doc_view->document, fv); assert(form); @@ -2185,6 +2596,9 @@ form_get_property_action(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2193,16 +2607,28 @@ form_get_property_action(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; fv = form_get_form_view(ctx, hobj, NULL); - if (!fv) return false; /* detached */ + if (!fv) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } form = find_form_by_form_view(doc_view->document, fv); assert(form); @@ -2228,6 +2654,9 @@ form_set_property_action(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2236,16 +2665,28 @@ form_set_property_action(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; fv = form_get_form_view(ctx, hobj, NULL); - if (!fv) return false; /* detached */ + if (!fv) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } form = find_form_by_form_view(doc_view->document, fv); assert(form); @@ -2274,11 +2715,20 @@ form_get_property_elements(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } fv = form_get_form_view(ctx, hobj, NULL); - if (!fv) return false; /* detached */ + if (!fv) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } /* jsform ('form') is form_elements' parent; who knows is that's correct */ JSObject *jsform_elems = JS_NewObjectWithGivenProto(ctx, &form_elements_class, hobj); @@ -2310,6 +2760,9 @@ form_get_property_encoding(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2318,16 +2771,28 @@ form_get_property_encoding(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; fv = form_get_form_view(ctx, hobj, NULL); - if (!fv) return false; /* detached */ + if (!fv) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } form = find_form_by_form_view(doc_view->document, fv); assert(form); @@ -2366,6 +2831,9 @@ form_set_property_encoding(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2374,16 +2842,28 @@ form_set_property_encoding(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; fv = form_get_form_view(ctx, hobj, NULL); - if (!fv) return false; /* detached */ + if (!fv) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } form = find_form_by_form_view(doc_view->document, fv); assert(form); @@ -2421,6 +2901,9 @@ form_get_property_length(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2429,16 +2912,28 @@ form_get_property_length(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; fv = form_get_form_view(ctx, hobj, NULL); - if (!fv) return false; /* detached */ + if (!fv) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } form = find_form_by_form_view(doc_view->document, fv); assert(form); @@ -2464,6 +2959,9 @@ form_get_property_method(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2472,16 +2970,28 @@ form_get_property_method(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; fv = form_get_form_view(ctx, hobj, NULL); - if (!fv) return false; /* detached */ + if (!fv) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } form = find_form_by_form_view(doc_view->document, fv); assert(form); @@ -2519,6 +3029,9 @@ form_set_property_method(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2527,16 +3040,28 @@ form_set_property_method(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; fv = form_get_form_view(ctx, hobj, NULL); - if (!fv) return false; /* detached */ + if (!fv) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } form = find_form_by_form_view(doc_view->document, fv); assert(form); @@ -2571,6 +3096,9 @@ form_get_property_name(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2579,16 +3107,28 @@ form_get_property_name(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; fv = form_get_form_view(ctx, hobj, NULL); - if (!fv) return false; /* detached */ + if (!fv) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } form = find_form_by_form_view(doc_view->document, fv); assert(form); @@ -2615,6 +3155,9 @@ form_set_property_name(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2623,16 +3166,28 @@ form_set_property_name(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; fv = form_get_form_view(ctx, hobj, NULL); - if (!fv) return false; /* detached */ + if (!fv) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } form = find_form_by_form_view(doc_view->document, fv); assert(form); @@ -2657,6 +3212,9 @@ form_get_property_target(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2665,16 +3223,28 @@ form_get_property_target(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; fv = form_get_form_view(ctx, hobj, NULL); - if (!fv) return false; /* detached */ + if (!fv) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } form = find_form_by_form_view(doc_view->document, fv); assert(form); @@ -2699,6 +3269,9 @@ form_set_property_target(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2707,16 +3280,28 @@ form_set_property_target(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &form_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; fv = form_get_form_view(ctx, hobj, NULL); - if (!fv) return false; /* detached */ + if (!fv) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } form = find_form_by_form_view(doc_view->document, fv); assert(form); @@ -2746,18 +3331,31 @@ form_reset(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &form_class, &args)) return false; + if (!JS_InstanceOf(ctx, hobj, &form_class, &args)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; + } vs = interpreter->vs; doc_view = vs->doc_view; /// fv = form_get_form_view(ctx, obj, argv); fv = form_get_form_view(ctx, hobj, rval); - if (!fv) return false; /* detached */ + if (!fv) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } form = find_form_by_form_view(doc_view->document, fv); assert(form); @@ -2791,19 +3389,32 @@ form_submit(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &form_class, &args)) return false; + if (!JS_InstanceOf(ctx, hobj, &form_class, &args)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; + } vs = interpreter->vs; doc_view = vs->doc_view; ses = doc_view->session; // fv = form_get_form_view(ctx, obj, argv); fv = form_get_form_view(ctx, hobj, rval); - if (!fv) return false; /* detached */ + if (!fv) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; /* detached */ + } form = find_form_by_form_view(doc_view->document, fv); assert(form); @@ -2987,6 +3598,9 @@ forms_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS:: JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -2995,8 +3609,12 @@ forms_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS:: /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &forms_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &forms_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; doc_view = vs->doc_view; @@ -3036,6 +3654,9 @@ forms_get_property_length(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -3044,11 +3665,18 @@ forms_get_property_length(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &forms_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &forms_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; @@ -3091,11 +3719,18 @@ forms_item2(JSContext *ctx, JS::HandleObject hobj, int index, JS::MutableHandleV struct form_view *fv; int counter = -1; - if (!JS_InstanceOf(ctx, hobj, &forms_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &forms_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -3134,12 +3769,20 @@ forms_namedItem(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &forms_class, &args)) return false; + if (!JS_InstanceOf(ctx, hobj, &forms_class, &args)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; + } vs = interpreter->vs; doc_view = vs->doc_view; diff --git a/src/ecmascript/spidermonkey/localstorage.c b/src/ecmascript/spidermonkey/localstorage.c index ed0969b7..cc4808d8 100644 --- a/src/ecmascript/spidermonkey/localstorage.c +++ b/src/ecmascript/spidermonkey/localstorage.c @@ -151,6 +151,9 @@ localstorage_getitem(JSContext *ctx, unsigned int argc, JS::Value *vp) if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -195,6 +198,9 @@ localstorage_setitem(JSContext *ctx, unsigned int argc, JS::Value *vp) if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); diff --git a/src/ecmascript/spidermonkey/location.c b/src/ecmascript/spidermonkey/location.c index 8ba19f17..e3ba2cf8 100644 --- a/src/ecmascript/spidermonkey/location.c +++ b/src/ecmascript/spidermonkey/location.c @@ -87,6 +87,9 @@ history_back(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -115,6 +118,9 @@ history_forward(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -140,6 +146,9 @@ history_go(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -243,6 +252,9 @@ location_get_property_hash(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -251,11 +263,18 @@ location_get_property_hash(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -285,6 +304,9 @@ location_get_property_host(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -293,17 +315,27 @@ location_get_property_host(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } char *str = get_uri_string(vs->uri, URI_HOST | URI_PORT); if (!str) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -326,6 +358,9 @@ location_get_property_hostname(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -334,17 +369,27 @@ location_get_property_hostname(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } char *str = get_uri_string(vs->uri, URI_HOST); if (!str) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -367,6 +412,9 @@ location_get_property_href(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -375,17 +423,27 @@ location_get_property_href(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } char *str = get_uri_string(vs->uri, URI_ORIGINAL); if (!str) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -408,6 +466,9 @@ location_get_property_origin(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -416,17 +477,27 @@ location_get_property_origin(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } char *str = get_uri_string(vs->uri, URI_SERVER); if (!str) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -449,6 +520,9 @@ location_get_property_pathname(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -457,11 +531,18 @@ location_get_property_pathname(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -491,6 +572,9 @@ location_get_property_port(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -499,11 +583,15 @@ location_get_property_port(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) { return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -531,6 +619,9 @@ location_get_property_protocol(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -539,11 +630,18 @@ location_get_property_protocol(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -577,6 +675,9 @@ location_get_property_search(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -585,11 +686,18 @@ location_get_property_search(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -621,6 +729,9 @@ location_set_property_hash(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -629,11 +740,18 @@ location_set_property_hash(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } location_goto_common(ctx, vs->doc_view, args[0]); @@ -655,6 +773,9 @@ location_set_property_host(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -663,11 +784,18 @@ location_set_property_host(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } location_goto_common(ctx, vs->doc_view, args[0]); @@ -688,6 +816,9 @@ location_set_property_hostname(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -696,11 +827,18 @@ location_set_property_hostname(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } location_goto_common(ctx, vs->doc_view, args[0]); @@ -721,6 +859,9 @@ location_set_property_href(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -729,11 +870,15 @@ location_set_property_href(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) { return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } location_goto_common(ctx, vs->doc_view, args[0]); @@ -754,6 +899,9 @@ location_set_property_pathname(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -762,11 +910,18 @@ location_set_property_pathname(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } location_goto_common(ctx, vs->doc_view, args[0]); @@ -787,6 +942,9 @@ location_set_property_port(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -795,11 +953,18 @@ location_set_property_port(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } location_goto_common(ctx, vs->doc_view, args[0]); @@ -820,6 +985,9 @@ location_set_property_protocol(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -828,11 +996,18 @@ location_set_property_protocol(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } location_goto_common(ctx, vs->doc_view, args[0]); @@ -853,6 +1028,9 @@ location_set_property_search(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -861,11 +1039,18 @@ location_set_property_search(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } location_goto_common(ctx, vs->doc_view, args[0]); @@ -897,6 +1082,9 @@ location_reload(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -905,11 +1093,18 @@ location_reload(JSContext *ctx, unsigned int argc, JS::Value *rval) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &location_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; diff --git a/src/ecmascript/spidermonkey/screen.c b/src/ecmascript/spidermonkey/screen.c index e8f63ebe..28c8f77e 100644 --- a/src/ecmascript/spidermonkey/screen.c +++ b/src/ecmascript/spidermonkey/screen.c @@ -91,6 +91,9 @@ screen_get_property_availHeight(JSContext *ctx, unsigned int argc, JS::Value *vp JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -99,17 +102,27 @@ screen_get_property_availHeight(JSContext *ctx, unsigned int argc, JS::Value *vp /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &screen_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &screen_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct document_view *doc_view = vs->doc_view; if (!doc_view) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -131,6 +144,9 @@ screen_get_property_availWidth(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -139,17 +155,27 @@ screen_get_property_availWidth(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &screen_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &screen_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct document_view *doc_view = vs->doc_view; if (!doc_view) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -171,6 +197,9 @@ screen_get_property_height(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -179,23 +208,36 @@ screen_get_property_height(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &screen_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &screen_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct document_view *doc_view = vs->doc_view; if (!doc_view) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct session *ses = doc_view->session; if (!ses) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -217,6 +259,9 @@ screen_get_property_width(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -225,23 +270,36 @@ screen_get_property_width(JSContext *ctx, unsigned int argc, JS::Value *vp) /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &screen_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &screen_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct document_view *doc_view = vs->doc_view; if (!doc_view) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct session *ses = doc_view->session; if (!ses) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } diff --git a/src/ecmascript/spidermonkey/unibar.c b/src/ecmascript/spidermonkey/unibar.c index e30e63c9..9b6866a7 100644 --- a/src/ecmascript/spidermonkey/unibar.c +++ b/src/ecmascript/spidermonkey/unibar.c @@ -119,6 +119,9 @@ unibar_get_property_visible(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -128,11 +131,18 @@ unibar_get_property_visible(JSContext *ctx, unsigned int argc, JS::Value *vp) * appropriate class but has one in its prototype chain. Fail * such calls. */ if (!JS_InstanceOf(ctx, hobj, &menubar_class, NULL) - && !JS_InstanceOf(ctx, hobj, &statusbar_class, NULL)) + && !JS_InstanceOf(ctx, hobj, &statusbar_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; @@ -175,6 +185,9 @@ unibar_set_property_visible(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -184,11 +197,18 @@ unibar_set_property_visible(JSContext *ctx, unsigned int argc, JS::Value *vp) * appropriate class but has one in its prototype chain. Fail * such calls. */ if (!JS_InstanceOf(ctx, hobj, &menubar_class, NULL) - && !JS_InstanceOf(ctx, hobj, &statusbar_class, NULL)) + && !JS_InstanceOf(ctx, hobj, &statusbar_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view; diff --git a/src/ecmascript/spidermonkey/window.c b/src/ecmascript/spidermonkey/window.c index 45ad639c..333336b3 100644 --- a/src/ecmascript/spidermonkey/window.c +++ b/src/ecmascript/spidermonkey/window.c @@ -155,6 +155,9 @@ window_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS: JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -162,8 +165,12 @@ window_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS: /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &window_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &window_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } vs = interpreter->vs; @@ -224,6 +231,9 @@ window_alert(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -275,12 +285,20 @@ window_open(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } struct ecmascript_interpreter *interpreter = JS::GetRealmPrivate(comp); - if (!JS_InstanceOf(ctx, hobj, &window_class, &args)) return false; + if (!JS_InstanceOf(ctx, hobj, &window_class, &args)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif + return false; + } vs = interpreter->vs; doc_view = vs->doc_view; @@ -387,6 +405,9 @@ window_setTimeout(JSContext *ctx, unsigned int argc, JS::Value *rval) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -433,8 +454,12 @@ window_get_property_closed(JSContext *ctx, JS::HandleObject hobj, JS::HandleId h /* This can be called if @obj if not itself an instance of the * appropriate class but has one in its prototype chain. Fail * such calls. */ - if (!JS_InstanceOf(ctx, hobj, &window_class, NULL)) + if (!JS_InstanceOf(ctx, hobj, &window_class, NULL)) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; + } boolean_to_jsval(ctx, vp, 0); @@ -488,6 +513,9 @@ window_get_property_self(JSContext *ctx, unsigned int argc, JS::Value *vp) args.rval().setObject(*hobj); +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -511,6 +539,9 @@ window_set_property_status(JSContext *ctx, unsigned int argc, JS::Value *vp) #endif JS::CallArgs args = CallArgsFromVp(argc, vp); if (args.length() != 1) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -518,6 +549,9 @@ window_set_property_status(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -549,6 +583,9 @@ window_get_property_top(JSContext *ctx, unsigned int argc, JS::Value *vp) JS::Realm *comp = js::GetContextRealm(ctx); if (!comp) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } @@ -559,6 +596,9 @@ window_get_property_top(JSContext *ctx, unsigned int argc, JS::Value *vp) vs = interpreter->vs; if (!vs) { +#ifdef ECMASCRIPT_DEBUG + fprintf(stderr, "%s:%s %d\n", __FILE__, __FUNCTION__, __LINE__); +#endif return false; } doc_view = vs->doc_view;