mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-08 12:37:37 +00:00
[INFER] Define static functions after defining the class for Number, String, bug 647537.
This commit is contained in:
parent
f673128fdb
commit
1e01fd5422
@ -1083,14 +1083,15 @@ js_InitNumberClass(JSContext *cx, JSObject *obj)
|
|||||||
/* XXX must do at least once per new thread, so do it per JSContext... */
|
/* XXX must do at least once per new thread, so do it per JSContext... */
|
||||||
FIX_FPU();
|
FIX_FPU();
|
||||||
|
|
||||||
if (!JS_DefineFunctionsWithPrefix(cx, obj, number_functions, js_Number_str))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
proto = js_InitClass(cx, obj, NULL, &js_NumberClass, Number, 1, type_NewNumber,
|
proto = js_InitClass(cx, obj, NULL, &js_NumberClass, Number, 1, type_NewNumber,
|
||||||
NULL, number_methods, NULL, NULL);
|
NULL, number_methods, NULL, NULL);
|
||||||
if (!proto || !(ctor = JS_GetConstructor(cx, proto)))
|
if (!proto || !(ctor = JS_GetConstructor(cx, proto)))
|
||||||
return NULL;
|
return NULL;
|
||||||
proto->setPrimitiveThis(Int32Value(0));
|
proto->setPrimitiveThis(Int32Value(0));
|
||||||
|
|
||||||
|
if (!JS_DefineFunctionsWithPrefix(cx, obj, number_functions, js_Number_str))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (!JS_DefineConstDoubles(cx, ctor, number_constants))
|
if (!JS_DefineConstDoubles(cx, ctor, number_constants))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -3589,10 +3589,6 @@ js_InitStringClass(JSContext *cx, JSObject *obj)
|
|||||||
{
|
{
|
||||||
JSObject *proto;
|
JSObject *proto;
|
||||||
|
|
||||||
/* Define the escape, unescape functions in the global object. */
|
|
||||||
if (!JS_DefineFunctionsWithPrefix(cx, obj, string_functions, js_String_str))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
proto = js_InitClass(cx, obj, NULL, &js_StringClass, js_String, 1,
|
proto = js_InitClass(cx, obj, NULL, &js_StringClass, js_String, 1,
|
||||||
type_NewString,
|
type_NewString,
|
||||||
NULL, string_methods,
|
NULL, string_methods,
|
||||||
@ -3608,6 +3604,10 @@ js_InitStringClass(JSContext *cx, JSObject *obj)
|
|||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Define the escape, unescape functions in the global object. */
|
||||||
|
if (!JS_DefineFunctionsWithPrefix(cx, obj, string_functions, js_String_str))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (!cx->addTypePropertyId(proto->getType(), lengthId, TYPE_INT32))
|
if (!cx->addTypePropertyId(proto->getType(), lengthId, TYPE_INT32))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user