@@ -91,25 +91,17 @@ static JSValue js_navigator_get_userAgent(JSContext *ctx, JSValue this_val)
9191 return JS_NewString (ctx , version );
9292}
9393
94- // static const JSCFunctionListEntry global_obj[] = {
95- // JS_CFUNC_DEF("gc", 0, js_gc),
96- // };
94+ static const JSCFunctionListEntry global_obj [] = {
95+ JS_CFUNC_DEF ("gc" , 0 , js_gc ),
96+ };
9797
98- // static const JSCFunctionListEntry navigator_proto_funcs[] = {
99- // JS_CGETSET_DEF2("userAgent", js_navigator_get_userAgent, NULL, JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE),
100- // JS_PROP_STRING_DEF("[Symbol.toStringTag]", "Navigator", JS_PROP_CONFIGURABLE),
101- // };
98+ static const JSCFunctionListEntry navigator_proto_funcs [] = {
99+ JS_CGETSET_DEF2 ("userAgent" , js_navigator_get_userAgent , NULL , JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE ),
100+ JS_PROP_STRING_DEF ("[Symbol.toStringTag]" , "Navigator" , JS_PROP_CONFIGURABLE ),
101+ };
102102
103103void js_set_global_objs (JSContext * ctx )
104104{
105- const JSCFunctionListEntry global_obj [] = {
106- JS_CFUNC_DEF ("gc" , 0 , js_gc ),
107- };
108- const JSCFunctionListEntry navigator_proto_funcs [] = {
109- JS_CGETSET_DEF2 ("userAgent" , js_navigator_get_userAgent , NULL , JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE ),
110- JS_PROP_STRING_DEF ("[Symbol.toStringTag]" , "Navigator" , JS_PROP_CONFIGURABLE ),
111- };
112-
113105 JSValue global = JS_GetGlobalObject (ctx );
114106 JS_SetPropertyFunctionList (
115107 ctx ,
0 commit comments