mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
JS_InternString is volatile, so I'll avoid its use
This commit is contained in:
parent
c7fb0150ff
commit
67aaece432
@ -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))
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user