2024-02-12 14:45:42 +00:00
|
|
|
/* File generated automatically by the QuickJS-ng compiler. */
|
|
|
|
|
|
|
|
#include "quickjs-libc.h"
|
|
|
|
|
2024-10-24 20:24:03 +00:00
|
|
|
const uint32_t qjsc_test_fib_size = 314;
|
2024-02-12 14:45:42 +00:00
|
|
|
|
2024-10-24 20:24:03 +00:00
|
|
|
const uint8_t qjsc_test_fib[314] = {
|
2024-11-05 20:55:42 +00:00
|
|
|
0x11, 0x0e, 0x01, 0x28, 0x65, 0x78, 0x61, 0x6d,
|
2024-09-24 08:01:08 +00:00
|
|
|
0x70, 0x6c, 0x65, 0x73, 0x2f, 0x74, 0x65, 0x73,
|
|
|
|
0x74, 0x5f, 0x66, 0x69, 0x62, 0x2e, 0x6a, 0x73,
|
2024-10-24 20:24:03 +00:00
|
|
|
0x01, 0x0c, 0x71, 0x6a, 0x73, 0x3a, 0x6f, 0x73,
|
2024-09-24 08:01:08 +00:00
|
|
|
0x01, 0x04, 0x6f, 0x73, 0x01, 0x0a, 0x69, 0x73,
|
|
|
|
0x57, 0x69, 0x6e, 0x01, 0x06, 0x66, 0x69, 0x62,
|
|
|
|
0x01, 0x10, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f,
|
|
|
|
0x72, 0x6d, 0x01, 0x0a, 0x77, 0x69, 0x6e, 0x33,
|
|
|
|
0x32, 0x01, 0x0c, 0x2e, 0x2f, 0x66, 0x69, 0x62,
|
|
|
|
0x2e, 0x01, 0x06, 0x64, 0x6c, 0x6c, 0x01, 0x04,
|
|
|
|
0x73, 0x6f, 0x01, 0x0e, 0x63, 0x6f, 0x6e, 0x73,
|
|
|
|
0x6f, 0x6c, 0x65, 0x01, 0x06, 0x6c, 0x6f, 0x67,
|
|
|
|
0x01, 0x16, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20,
|
|
|
|
0x57, 0x6f, 0x72, 0x6c, 0x64, 0x01, 0x10, 0x66,
|
|
|
|
0x69, 0x62, 0x28, 0x31, 0x30, 0x29, 0x3d, 0x0d,
|
2024-11-05 20:55:42 +00:00
|
|
|
0xbc, 0x03, 0x01, 0xbe, 0x03, 0x00, 0x00, 0x01,
|
2024-09-24 08:01:08 +00:00
|
|
|
0x00, 0xfc, 0x01, 0x00, 0x01, 0x0c, 0x20, 0xfa,
|
|
|
|
0x01, 0xa2, 0x01, 0x00, 0x00, 0x00, 0x05, 0x03,
|
2024-11-05 20:55:42 +00:00
|
|
|
0x00, 0x73, 0x00, 0xc0, 0x03, 0x00, 0x0d, 0xc2,
|
|
|
|
0x03, 0x00, 0x0d, 0xc4, 0x03, 0x01, 0x0d, 0x08,
|
|
|
|
0xea, 0x02, 0x29, 0x65, 0x00, 0x00, 0x41, 0xe3,
|
|
|
|
0x00, 0x00, 0x00, 0x04, 0xe4, 0x00, 0x00, 0x00,
|
2024-09-24 11:04:45 +00:00
|
|
|
0xae, 0xe2, 0x06, 0x11, 0xf2, 0xeb, 0x0b, 0x70,
|
2024-11-05 20:55:42 +00:00
|
|
|
0x42, 0xe2, 0x00, 0x00, 0x00, 0xe3, 0x0e, 0xec,
|
|
|
|
0x24, 0x0e, 0x04, 0xe5, 0x00, 0x00, 0x00, 0x42,
|
2024-09-24 11:04:45 +00:00
|
|
|
0x5d, 0x00, 0x00, 0x00, 0x65, 0x01, 0x00, 0xea,
|
2024-11-05 20:55:42 +00:00
|
|
|
0x08, 0x04, 0xe6, 0x00, 0x00, 0x00, 0xec, 0x06,
|
|
|
|
0x04, 0xe7, 0x00, 0x00, 0x00, 0x24, 0x01, 0x00,
|
|
|
|
0x35, 0x8b, 0xec, 0xd4, 0x38, 0xe8, 0x00, 0x00,
|
|
|
|
0x00, 0x42, 0xe9, 0x00, 0x00, 0x00, 0x04, 0xea,
|
2024-09-24 08:01:08 +00:00
|
|
|
0x00, 0x00, 0x00, 0x24, 0x01, 0x00, 0x0e, 0x38,
|
2024-11-05 20:55:42 +00:00
|
|
|
0xe8, 0x00, 0x00, 0x00, 0x42, 0xe9, 0x00, 0x00,
|
|
|
|
0x00, 0x04, 0xeb, 0x00, 0x00, 0x00, 0x65, 0x02,
|
2024-09-24 11:04:45 +00:00
|
|
|
0x00, 0xbc, 0x0a, 0xef, 0x24, 0x02, 0x00, 0x0e,
|
2024-11-05 20:55:42 +00:00
|
|
|
0x06, 0x2e, 0xbc, 0x03, 0x01, 0x01, 0x22, 0x01,
|
2024-09-24 08:01:08 +00:00
|
|
|
0x01, 0x00, 0x04, 0x08, 0x1e, 0x2a, 0x18, 0x1b,
|
|
|
|
0x08, 0x0d, 0x3b, 0x1b, 0x0c, 0x07, 0x04, 0x25,
|
|
|
|
0x08, 0x0c, 0x04, 0x07, 0x10, 0x43, 0x2c, 0x25,
|
|
|
|
0x10, 0x25, 0x04, 0x27, 0x6b, 0x62, 0x00, 0x4d,
|
|
|
|
0x30, 0x00,
|
2024-02-12 14:45:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static JSContext *JS_NewCustomContext(JSRuntime *rt)
|
|
|
|
{
|
|
|
|
JSContext *ctx = JS_NewContext(rt);
|
|
|
|
if (!ctx)
|
|
|
|
return NULL;
|
|
|
|
{
|
2024-09-10 20:47:40 +00:00
|
|
|
extern JSModuleDef *js_init_module_os(JSContext *ctx, const char *name);
|
2024-10-24 20:24:03 +00:00
|
|
|
js_init_module_os(ctx, "qjs:os");
|
2024-02-12 14:45:42 +00:00
|
|
|
}
|
|
|
|
return ctx;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
JSRuntime *rt;
|
|
|
|
JSContext *ctx;
|
|
|
|
rt = JS_NewRuntime();
|
|
|
|
js_std_set_worker_new_context_func(JS_NewCustomContext);
|
|
|
|
js_std_init_handlers(rt);
|
|
|
|
JS_SetModuleLoaderFunc(rt, NULL, js_module_loader, NULL);
|
|
|
|
ctx = JS_NewCustomContext(rt);
|
|
|
|
js_std_add_helpers(ctx, argc, argv);
|
|
|
|
js_std_eval_binary(ctx, qjsc_test_fib, qjsc_test_fib_size, 0);
|
|
|
|
js_std_loop(ctx);
|
|
|
|
JS_FreeContext(ctx);
|
|
|
|
js_std_free_handlers(rt);
|
|
|
|
JS_FreeRuntime(rt);
|
|
|
|
return 0;
|
|
|
|
}
|