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
Родитель c7fb0150ff
Коммит 67aaece432
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -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 {