@@ -167,18 +167,20 @@ int main(int argc, char **argv) {
167167 lepus_std_add_helpers (ctx, 0 , NULL );
168168
169169 LEPUSValue global_obj = LEPUS_GetGlobalObject (ctx);
170- LEPUSValue cfunc = LEPUS_NewCFunction (ctx, js_std_load_file, " read" , 1 );
171- HandleScope func_scope (ctx, &cfunc, HANDLE_TYPE_LEPUS_VALUE);
172- LEPUS_SetPropertyStr (ctx, global_obj, " read" , cfunc);
173- cfunc = LEPUS_NewCFunction (
174- ctx,
175- [](LEPUSContext *ctx, LEPUSValue this_obj, int32_t argc,
176- LEPUSValue *argv) {
177- LEPUS_RunGC (LEPUS_GetRuntime (ctx));
178- return LEPUS_UNDEFINED;
179- },
180- " " , 0 );
181- LEPUS_SetPropertyStr (ctx, global_obj, " gc" , cfunc);
170+ {
171+ LEPUSValue cfunc = LEPUS_NewCFunction (ctx, js_std_load_file, " read" , 1 );
172+ HandleScope func_scope (ctx, &cfunc, HANDLE_TYPE_LEPUS_VALUE);
173+ LEPUS_SetPropertyStr (ctx, global_obj, " read" , cfunc);
174+ cfunc = LEPUS_NewCFunction (
175+ ctx,
176+ [](LEPUSContext *ctx, LEPUSValue this_obj, int32_t argc,
177+ LEPUSValue *argv) {
178+ LEPUS_RunGC (LEPUS_GetRuntime (ctx));
179+ return LEPUS_UNDEFINED;
180+ },
181+ " " , 0 );
182+ LEPUS_SetPropertyStr (ctx, global_obj, " gc" , cfunc);
183+ }
182184 if (!LEPUS_IsGCMode (ctx)) {
183185 LEPUS_FreeValue (ctx, global_obj);
184186 }
0 commit comments