@@ -1516,12 +1516,13 @@ static const JSCFunctionListEntry js_std_file_proto_funcs[] = {
15161516static int js_std_init (JSContext * ctx , JSModuleDef * m )
15171517{
15181518 JSValue proto ;
1519+ JSRuntime * rt = JS_GetRuntime (ctx );
15191520
15201521 /* FILE class */
15211522 /* the class ID is created once */
1522- JS_NewClassID (& js_std_file_class_id );
1523+ JS_NewClassID (rt , & js_std_file_class_id );
15231524 /* the class is created once per runtime */
1524- JS_NewClass (JS_GetRuntime ( ctx ) , js_std_file_class_id , & js_std_file_class );
1525+ JS_NewClass (rt , js_std_file_class_id , & js_std_file_class );
15251526 proto = JS_NewObject (ctx );
15261527 JS_SetPropertyFunctionList (ctx , proto , js_std_file_proto_funcs ,
15271528 countof (js_std_file_proto_funcs ));
@@ -3658,20 +3659,20 @@ static const JSCFunctionListEntry js_os_funcs[] = {
36583659
36593660static int js_os_init (JSContext * ctx , JSModuleDef * m )
36603661{
3662+ JSRuntime * rt = JS_GetRuntime (ctx );
36613663 os_poll_func = js_os_poll ;
36623664
36633665 /* OSTimer class */
3664- JS_NewClassID (& js_os_timer_class_id );
3665- JS_NewClass (JS_GetRuntime ( ctx ) , js_os_timer_class_id , & js_os_timer_class );
3666+ JS_NewClassID (rt , & js_os_timer_class_id );
3667+ JS_NewClass (rt , js_os_timer_class_id , & js_os_timer_class );
36663668
36673669#ifdef USE_WORKER
36683670 {
3669- JSRuntime * rt = JS_GetRuntime (ctx );
36703671 JSThreadState * ts = JS_GetRuntimeOpaque (rt );
36713672 JSValue proto , obj ;
36723673 /* Worker class */
3673- JS_NewClassID (& js_worker_class_id );
3674- JS_NewClass (JS_GetRuntime ( ctx ) , js_worker_class_id , & js_worker_class );
3674+ JS_NewClassID (rt , & js_worker_class_id );
3675+ JS_NewClass (rt , js_worker_class_id , & js_worker_class );
36753676 proto = JS_NewObject (ctx );
36763677 JS_SetPropertyFunctionList (ctx , proto , js_worker_proto_funcs , countof (js_worker_proto_funcs ));
36773678
0 commit comments