JS_InternString is volatile, so I'll avoid its use

This commit is contained in:
shaver%netscape.com 1998-08-31 22:46:06 +00:00
parent c7fb0150ff
commit 67aaece432
2 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ DOM_NewAttributeObject(JSContext *cx, DOM_Attribute *attr)
return NULL;
}
str = JS_InternString(cx, node->name);
str = JS_NewStringCopyZ, node->name);
v = STRING_TO_JSVAL(str);
if (!str ||
!JS_SetProperty(cx, obj, "name", &v))

View File

@ -106,7 +106,7 @@ element_getAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
value = element->ops->getAttribute(cx, element, JS_GetStringBytes(name),
&cache);
if (value) {
*rval = STRING_TO_JSVAL(JS_InternString(cx, value));
*rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, value));
if (!JSVAL_TO_STRING(*rval))
return JS_FALSE;
} else {