mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
[INFER] Define static functions after defining the class for Number, String, bug 647537.
This commit is contained in:
parent
2390894c39
commit
e90a588261
@ -1083,14 +1083,15 @@ js_InitNumberClass(JSContext *cx, JSObject *obj)
|
||||
/* XXX must do at least once per new thread, so do it per JSContext... */
|
||||
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,
|
||||
NULL, number_methods, NULL, NULL);
|
||||
if (!proto || !(ctor = JS_GetConstructor(cx, proto)))
|
||||
return NULL;
|
||||
proto->setPrimitiveThis(Int32Value(0));
|
||||
|
||||
if (!JS_DefineFunctionsWithPrefix(cx, obj, number_functions, js_Number_str))
|
||||
return NULL;
|
||||
|
||||
if (!JS_DefineConstDoubles(cx, ctor, number_constants))
|
||||
return NULL;
|
||||
|
||||
|
@ -3589,10 +3589,6 @@ js_InitStringClass(JSContext *cx, JSObject *obj)
|
||||
{
|
||||
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,
|
||||
type_NewString,
|
||||
NULL, string_methods,
|
||||
@ -3608,6 +3604,10 @@ js_InitStringClass(JSContext *cx, JSObject *obj)
|
||||
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))
|
||||
return NULL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user