diff --git a/src/ecmascript/spidermonkey/element.cpp b/src/ecmascript/spidermonkey/element.cpp index 1071d3539..6afd9e040 100644 --- a/src/ecmascript/spidermonkey/element.cpp +++ b/src/ecmascript/spidermonkey/element.cpp @@ -4831,11 +4831,18 @@ element_isEqualNode(JSContext *ctx, unsigned int argc, JS::Value *rval) dom_node *el = (dom_node *)JS::GetMaybePtrFromReservedSlot(hobj, 0); if (!el) { - args.rval().setBoolean(false); - return true; + return false; + } + dom_node *el2 = NULL; + + if (!args[0].isNull()) { + JS::RootedObject node(ctx, &args[0].toObject()); + el2 = (dom_node *)JS::GetMaybePtrFromReservedSlot(node, 0); + } + + if (!el2) { + return false; } - JS::RootedObject node(ctx, &args[0].toObject()); - dom_node *el2 = (dom_node *)JS::GetMaybePtrFromReservedSlot(node, 0); struct string first; struct string second; diff --git a/src/ecmascript/spidermonkey/fragment.cpp b/src/ecmascript/spidermonkey/fragment.cpp index fda2f43ff..d3f1e2e9b 100644 --- a/src/ecmascript/spidermonkey/fragment.cpp +++ b/src/ecmascript/spidermonkey/fragment.cpp @@ -2010,11 +2010,18 @@ fragment_isEqualNode(JSContext *ctx, unsigned int argc, JS::Value *rval) dom_node *el = (dom_node *)JS::GetMaybePtrFromReservedSlot(hobj, 0); if (!el) { - args.rval().setBoolean(false); - return true; + return false; + } + dom_node *el2 = NULL; + + if (!args[0].isNull()) { + JS::RootedObject node(ctx, &args[0].toObject()); + el2 = (dom_node *)JS::GetMaybePtrFromReservedSlot(node, 0); + } + + if (!el2) { + return false; } - JS::RootedObject node(ctx, &args[0].toObject()); - dom_node *el2 = (dom_node *)JS::GetMaybePtrFromReservedSlot(node, 0); struct string first; struct string second; diff --git a/src/ecmascript/spidermonkey/text.cpp b/src/ecmascript/spidermonkey/text.cpp index 48c3f2ca0..4ea3c5fe4 100644 --- a/src/ecmascript/spidermonkey/text.cpp +++ b/src/ecmascript/spidermonkey/text.cpp @@ -2074,11 +2074,18 @@ text_isEqualNode(JSContext *ctx, unsigned int argc, JS::Value *rval) dom_node *el = (dom_node *)JS::GetMaybePtrFromReservedSlot(hobj, 0); if (!el) { - args.rval().setBoolean(false); - return true; + return false; + } + dom_node *el2 = NULL; + + if (!args[0].isNull()) { + JS::RootedObject node(ctx, &args[0].toObject()); + el2 = (dom_node *)JS::GetMaybePtrFromReservedSlot(node, 0); + } + + if (!el2) { + return false; } - JS::RootedObject node(ctx, &args[0].toObject()); - dom_node *el2 = (dom_node *)JS::GetMaybePtrFromReservedSlot(node, 0); struct string first; struct string second;