1 | /* File generated automatically by the QuickJS compiler. */ |
2 | |
3 | #include "quickjs-libc.h" |
4 | |
5 | const uint32_t qjsc_hello_size = 93; |
6 | |
7 | const uint8_t qjsc_hello[93] = { |
8 | 0x04, 0x04, 0x0e, 0x63, 0x6f, 0x6e, 0x73, 0x6f, |
9 | 0x6c, 0x65, 0x06, 0x6c, 0x6f, 0x67, 0x16, 0x48, |
10 | 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, |
11 | 0x6c, 0x64, 0x22, 0x65, 0x78, 0x61, 0x6d, 0x70, |
12 | 0x6c, 0x65, 0x73, 0x2f, 0x68, 0x65, 0x6c, 0x6c, |
13 | 0x6f, 0x2e, 0x6a, 0x73, 0x0c, 0x00, 0x06, 0x00, |
14 | 0xa4, 0x01, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00, |
15 | 0x14, 0x01, 0xa6, 0x01, 0x00, 0x00, 0x00, 0x39, |
16 | 0xdf, 0x00, 0x00, 0x00, 0x43, 0xe0, 0x00, 0x00, |
17 | 0x00, 0x04, 0xe1, 0x00, 0x00, 0x00, 0x24, 0x01, |
18 | 0x00, 0xcf, 0x28, 0xc4, 0x03, 0x06, 0x00, 0x00, |
19 | 0x1b, 0x0e, 0x34, 0x08, 0x00, |
20 | }; |
21 | |
22 | static JSContext *JS_NewCustomContext(JSRuntime *rt) |
23 | { |
24 | JSContext *ctx = JS_NewContextRaw(rt); |
25 | if (!ctx) |
26 | return NULL; |
27 | JS_AddIntrinsicBaseObjects(ctx); |
28 | JS_AddIntrinsicWeakRef(ctx); |
29 | return ctx; |
30 | } |
31 | |
32 | int main(int argc, char **argv) |
33 | { |
34 | JSRuntime *rt; |
35 | JSContext *ctx; |
36 | rt = JS_NewRuntime(); |
37 | js_std_set_worker_new_context_func(JS_NewCustomContext); |
38 | js_std_init_handlers(rt); |
39 | ctx = JS_NewCustomContext(rt); |
40 | js_std_add_helpers(ctx, argc, argv); |
41 | js_std_eval_binary(ctx, qjsc_hello, qjsc_hello_size, 0); |
42 | js_std_loop(ctx); |
43 | js_std_free_handlers(rt); |
44 | JS_FreeContext(ctx); |
45 | JS_FreeRuntime(rt); |
46 | return 0; |
47 | } |
48 | |