From 70eac2595a44e19ef6de87fd1494c0a34706ee06 Mon Sep 17 00:00:00 2001 From: "igor@mir2.org" Date: Wed, 5 Mar 2008 12:18:52 -0800 Subject: [PATCH] bug=355258 r=brendan a1.9=beltzner --- js/src/jsinterp.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/js/src/jsinterp.c b/js/src/jsinterp.c index 3a7c1a8e1dd..cd98b14fb52 100644 --- a/js/src/jsinterp.c +++ b/js/src/jsinterp.c @@ -884,8 +884,8 @@ JSBool js_OnUnknownMethod(JSContext *cx, jsval *vp) { JSObject *obj; - JSTempValueRooter tvr; jsid id; + JSTempValueRooter tvr; JSBool ok; JS_ASSERT(!JSVAL_IS_PRIMITIVE(vp[1])); @@ -915,6 +915,16 @@ js_OnUnknownMethod(JSContext *cx, jsval *vp) if (JSVAL_IS_PRIMITIVE(tvr.u.value)) { vp[0] = tvr.u.value; } else { +#if JS_HAS_XML_SUPPORT + /* Extract the function name from function::name qname. */ + if (!JSVAL_IS_PRIMITIVE(vp[0])) { + obj = JSVAL_TO_OBJECT(vp[0]); + if (!js_IsFunctionQName(cx, obj, &id)) + return JS_FALSE; + if (id != 0) + vp[0] = ID_TO_VALUE(id); + } +#endif obj = js_NewObject(cx, &js_NoSuchMethodClass, NULL, NULL); if (!obj) { ok = JS_FALSE;