Fix GC_MARK_DEBUG-#ifdef'd code for E4X (timeless private bug).

This commit is contained in:
brendan%mozilla.org 2005-02-01 02:35:31 +00:00
parent 8da3cdff42
commit 0c5c5f6341
2 changed files with 30 additions and 4 deletions

View File

@ -909,9 +909,34 @@ gc_dump_thing(JSGCThing *thing, uint8 flags, GCMarkNode *prev, FILE *fp)
fprintf(fp, "object %8p %s", privateThing, className);
break;
}
case GCX_NAMESPACE:
{
JSXMLNamespace *ns = (JSXMLNamespace *)thing;
fprintf(fp, "namespace %s:%s",
JS_GetStringBytes(ns->prefix), JS_GetStringBytes(ns->uri));
break;
}
case GCX_QNAME:
{
JSXMLQName *qn = (JSXMLQName *)thing;
fprintf(fp, "qname %s(%s):%s",
JS_GetStringBytes(qn->prefix), JS_GetStringBytes(qn->uri),
JS_GetStringBytes(qn->localName));
break;
}
case GCX_XML:
{
extern const char *js_xml_class_str[];
JSXML *xml = (JSXML *)thing;
fprintf(fp, "xml %8p %s", xml, js_xml_class_str[xml->xml_class]);
break;
}
case GCX_DOUBLE:
fprintf(fp, "double %g", *(jsdouble *)thing);
break;
case GCX_PRIVATE:
fprintf(fp, "private %8p", (void *)thing);
break;
default:
fprintf(fp, "string %s", JS_GetStringBytes((JSString *)thing));
break;
@ -1356,7 +1381,7 @@ down:
: NULL;
if (scope)
vp += DecodeDSWIndex(scope->dswIndex, vp);
/*
* Alas, we must search for the reversed pointer. If we used the
* scope->dswIndex hint, we'll step over a few slots for objects with

View File

@ -2308,7 +2308,7 @@ GetNamespace(JSContext *cx, JSXMLQName *qn, const JSXMLArray *inScopeNSes)
*
* Per 10.3.2.1, the namespace attribute in t has an empty string
* prefix (*not* a null prefix), per 10.3.2.1 Step 6(h)(i)(1):
*
*
* 1. If the [local name] property of a is "xmlns"
* a. Map ns.prefix to the empty string
*
@ -6044,7 +6044,8 @@ out:
static const char js_attribute_str[] = "attribute";
static const char js_text_str[] = "text";
static const char *xml_class_str[] = {
/* Exported to jsgc.c #ifdef GC_MARK_DEBUG. */
const char *js_xml_class_str[] = {
"list",
"element",
js_attribute_str,
@ -6061,7 +6062,7 @@ xml_nodeKind(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
JSString *str;
xml = (JSXML *) JS_GetPrivate(cx, obj);
str = JS_InternString(cx, xml_class_str[xml->xml_class]);
str = JS_InternString(cx, js_xml_class_str[xml->xml_class]);
if (!str)
return JS_FALSE;
*rval = STRING_TO_JSVAL(str);