emnapi 1.9.2 → 2.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/CMakeLists.txt +127 -57
  2. package/README.md +164 -776
  3. package/cmake/wasm32.cmake +0 -3
  4. package/common.gypi +16 -14
  5. package/dist/library_async_work.js +390 -0
  6. package/dist/library_napi.js +1743 -2759
  7. package/dist/library_threadsafe_function.js +1178 -0
  8. package/dist/library_v8.js +1594 -0
  9. package/emnapi.gyp +37 -0
  10. package/include/node/emnapi.h +39 -3
  11. package/include/node/js_native_api.h +10 -0
  12. package/include/node/js_native_api_types.h +26 -0
  13. package/include/node/node.h +198 -0
  14. package/include/node/node_api.h +0 -10
  15. package/include/node/node_buffer.h +92 -0
  16. package/include/node/node_object_wrap.h +132 -0
  17. package/include/node/node_version.h +110 -0
  18. package/include/node/uv/unix.h +1 -0
  19. package/include/node/uv/version.h +43 -0
  20. package/include/node/uv.h +6 -0
  21. package/index.js +15 -7
  22. package/lib/wasm32-emscripten/libemnapi-mt.a +0 -0
  23. package/lib/wasm32-emscripten/libemnapi.a +0 -0
  24. package/lib/wasm32-wasip1-threads/libemnapi-mt.a +0 -0
  25. package/lib/wasm32-wasip1-threads/libemnapi-napi-rs-mt.a +0 -0
  26. package/lib/wasm32-wasip1-threads/libemnapi.a +0 -0
  27. package/lib/wasm64-emscripten/libemnapi-mt.a +0 -0
  28. package/lib/wasm64-emscripten/libemnapi.a +0 -0
  29. package/package.json +1 -1
  30. package/src/async_cleanup_hook.c +6 -6
  31. package/src/emnapi_internal.h +5 -10
  32. package/src/js_native_api.c +37 -21
  33. package/src/js_native_api_internal.h +66 -0
  34. package/src/node_api.c +1 -1
  35. package/src/threadsafe_function.c +2 -2
  36. package/src/uv/unix/thread.c +21 -0
  37. package/src/v8/array.cc +19 -0
  38. package/src/v8/boolean.cc +26 -0
  39. package/src/v8/date.cc +15 -0
  40. package/src/v8/exception.cc +48 -0
  41. package/src/v8/external.cc +23 -0
  42. package/src/v8/function.cc +35 -0
  43. package/src/v8/handle_scope.cc +46 -0
  44. package/src/v8/internal.cc +126 -0
  45. package/src/v8/internal.h +41 -0
  46. package/src/v8/isolate.cc +35 -0
  47. package/src/v8/json.cc +25 -0
  48. package/src/v8/node.cc +24 -0
  49. package/src/v8/number.cc +62 -0
  50. package/src/v8/object.cc +106 -0
  51. package/src/v8/script.cc +75 -0
  52. package/src/v8/string.cc +104 -0
  53. package/src/v8/template.cc +234 -0
  54. package/src/v8/try_catch.cc +50 -0
  55. package/src/v8/v8_impl.h +42 -0
  56. package/src/v8/value.cc +138 -0
  57. package/lib/wasm32/libdlmalloc-mt.a +0 -0
  58. package/lib/wasm32/libdlmalloc.a +0 -0
  59. package/lib/wasm32/libemmalloc-mt.a +0 -0
  60. package/lib/wasm32/libemmalloc.a +0 -0
  61. package/lib/wasm32/libemnapi-basic-mt.a +0 -0
  62. package/lib/wasm32/libemnapi-basic.a +0 -0
  63. package/lib/wasm32/libemnapi.a +0 -0
  64. package/lib/wasm32-emscripten/libemnapi-basic.a +0 -0
  65. package/lib/wasm32-wasi/libemnapi-basic-mt.a +0 -0
  66. package/lib/wasm32-wasi/libemnapi-basic.a +0 -0
  67. package/lib/wasm32-wasi/libemnapi.a +0 -0
  68. package/lib/wasm32-wasi-threads/libemnapi-basic-mt.a +0 -0
  69. package/lib/wasm32-wasi-threads/libemnapi-basic-napi-rs-mt.a +0 -0
  70. package/lib/wasm32-wasi-threads/libemnapi-basic.a +0 -0
  71. package/lib/wasm32-wasi-threads/libemnapi-mt.a +0 -0
  72. package/lib/wasm32-wasi-threads/libemnapi-napi-rs-mt.a +0 -0
  73. package/lib/wasm32-wasi-threads/libemnapi.a +0 -0
  74. package/lib/wasm32-wasip1/libemnapi-basic-mt.a +0 -0
  75. package/lib/wasm32-wasip1/libemnapi-basic.a +0 -0
  76. package/lib/wasm32-wasip1/libemnapi.a +0 -0
  77. package/lib/wasm32-wasip1-threads/libemnapi-basic-mt.a +0 -0
  78. package/lib/wasm32-wasip1-threads/libemnapi-basic-napi-rs-mt.a +0 -0
  79. package/lib/wasm32-wasip1-threads/libemnapi-basic.a +0 -0
  80. package/lib/wasm64-emscripten/libemnapi-basic.a +0 -0
@@ -0,0 +1,1594 @@
1
+ //#region src/v8/array.ts
2
+ /**
3
+ * @__deps $emnapiCtx
4
+ * @__sig ppi
5
+ */
6
+ function __v8_array_new(context, value) {
7
+ return emnapiCtx.napiValueFromJsValue(Array(value));
8
+ }
9
+ /**
10
+ * @__deps $emnapiCtx
11
+ * @__sig ip
12
+ */
13
+ function __v8_array_length(array) {
14
+ const arr = emnapiCtx.jsValueFromNapiValue(array);
15
+ return arr.length;
16
+ }
17
+ //#endregion src/v8/array.ts
18
+ //#region src/v8/boolean.ts
19
+ /**
20
+ * @__deps $emnapiCtx
21
+ * @__sig ip
22
+ */
23
+ function __v8_boolean_value(value) {
24
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
25
+ return jsValue ? 1 : 0;
26
+ }
27
+ /**
28
+ * @__deps $emnapiCtx
29
+ * @__sig ppi
30
+ */
31
+ function __v8_boolean_object_new(isolate, value) {
32
+ // eslint-disable-next-line no-new-wrappers
33
+ return emnapiCtx.napiValueFromJsValue(new Boolean(value));
34
+ }
35
+ /**
36
+ * @__deps $emnapiCtx
37
+ * @__sig ip
38
+ */
39
+ function __v8_boolean_object_value_of(self) {
40
+ const boolObj = emnapiCtx.jsValueFromNapiValue(self);
41
+ return boolObj.valueOf() ? 1 : 0;
42
+ }
43
+ //#endregion src/v8/boolean.ts
44
+ //#region src/v8/date.ts
45
+ /**
46
+ * @__deps $emnapiCtx
47
+ * @__sig ppd
48
+ */
49
+ function __v8_date_new(context, value) {
50
+ return emnapiCtx.napiValueFromJsValue(new Date(value));
51
+ }
52
+ //#endregion src/v8/date.ts
53
+ //#region src/v8/exception.ts
54
+ /**
55
+ * @__deps $emnapiCtx
56
+ * @__sig ppp
57
+ */
58
+ function __v8_exception_error(message, options) {
59
+ return emnapiCtx.napiValueFromJsValue(new Error(emnapiCtx.jsValueFromNapiValue(message),
60
+ // @ts-ignore
61
+ emnapiCtx.jsValueFromNapiValue(options)));
62
+ }
63
+ /**
64
+ * @__deps $emnapiCtx
65
+ * @__sig ppp
66
+ */
67
+ function __v8_exception_type_error(message, options) {
68
+ return emnapiCtx.napiValueFromJsValue(new TypeError(emnapiCtx.jsValueFromNapiValue(message),
69
+ // @ts-ignore
70
+ emnapiCtx.jsValueFromNapiValue(options)));
71
+ }
72
+ /**
73
+ * @__deps $emnapiCtx
74
+ * @__sig ppp
75
+ */
76
+ function __v8_exception_range_error(message, options) {
77
+ return emnapiCtx.napiValueFromJsValue(new RangeError(emnapiCtx.jsValueFromNapiValue(message),
78
+ // @ts-ignore
79
+ emnapiCtx.jsValueFromNapiValue(options)));
80
+ }
81
+ /**
82
+ * @__deps $emnapiCtx
83
+ * @__sig ppp
84
+ */
85
+ function __v8_exception_reference_error(message, options) {
86
+ return emnapiCtx.napiValueFromJsValue(new ReferenceError(emnapiCtx.jsValueFromNapiValue(message),
87
+ // @ts-ignore
88
+ emnapiCtx.jsValueFromNapiValue(options)));
89
+ }
90
+ /**
91
+ * @__deps $emnapiCtx
92
+ * @__sig ppp
93
+ */
94
+ function __v8_exception_syntax_error(message, options) {
95
+ return emnapiCtx.napiValueFromJsValue(new SyntaxError(emnapiCtx.jsValueFromNapiValue(message),
96
+ // @ts-ignore
97
+ emnapiCtx.jsValueFromNapiValue(options)));
98
+ }
99
+ //#endregion src/v8/exception.ts
100
+ //#region src/v8/external.ts
101
+ /**
102
+ * @__deps $emnapiCtx
103
+ * @__sig ppp
104
+ */
105
+ function __v8_external_new(isolate, data) {
106
+ const external = emnapiCtx.isolate.createExternal(data);
107
+ return emnapiCtx.napiValueFromJsValue(external);
108
+ }
109
+ /**
110
+ * @__deps $emnapiCtx
111
+ * @__sig pp
112
+ */
113
+ function __v8_external_value(external) {
114
+ const obj = emnapiCtx.jsValueFromNapiValue(external);
115
+ return emnapiCtx.isolate.getExternalValue(obj);
116
+ }
117
+ //#endregion src/v8/external.ts
118
+ //#region src/v8/function.ts
119
+ /**
120
+ * @__deps $emnapiCtx
121
+ * @__sig vpp
122
+ */
123
+ function __v8_function_set_name(fn, name) {
124
+ if (!emnapiCtx.features.setFunctionName) {
125
+ return;
126
+ }
127
+ const str = emnapiCtx.jsValueFromNapiValue(name);
128
+ const func = emnapiCtx.jsValueFromNapiValue(fn);
129
+ emnapiCtx.features.setFunctionName(func, str);
130
+ }
131
+ /**
132
+ * @__deps $emnapiCtx
133
+ * @__sig ppppp
134
+ */
135
+ function __v8_function_new_instance(fn, ctx, argc, argv) {
136
+ if (emnapiCtx.isolate.hasPendingException())
137
+ return 1;
138
+ const Ctor = emnapiCtx.jsValueFromNapiValue(fn);
139
+ {{{ from64('argv') }}};
140
+ let i;
141
+ let ret;
142
+ try {
143
+ if (emnapiCtx.features.Reflect) {
144
+ const argList = Array(argc);
145
+ for (i = 0; i < argc; i++) {
146
+ const argVal = {{{ makeGetValue('argv', 'i * ' + POINTER_SIZE, '*') }}};
147
+ argList[i] = emnapiCtx.jsValueFromNapiValue(argVal);
148
+ }
149
+ ret = emnapiCtx.features.Reflect.construct(Ctor, argList, Ctor);
150
+ }
151
+ else {
152
+ const args = Array(argc + 1);
153
+ args[0] = undefined;
154
+ for (i = 0; i < argc; i++) {
155
+ const argVal = {{{ makeGetValue('argv', 'i * ' + POINTER_SIZE, '*') }}};
156
+ args[i + 1] = emnapiCtx.jsValueFromNapiValue(argVal);
157
+ }
158
+ const BoundCtor = Ctor.bind.apply(Ctor, args);
159
+ ret = new BoundCtor();
160
+ }
161
+ }
162
+ catch (err) {
163
+ emnapiCtx.isolate.throwException(err);
164
+ return 1;
165
+ }
166
+ return emnapiCtx.napiValueFromJsValue(ret);
167
+ }
168
+ /**
169
+ * @__deps $emnapiCtx
170
+ * @__sig ppppip
171
+ */
172
+ function __v8_function_call(fn, ctx, recv, argc, argv) {
173
+ if (emnapiCtx.isolate.hasPendingException())
174
+ return 1;
175
+ const func = emnapiCtx.jsValueFromNapiValue(fn);
176
+ const thisArg = emnapiCtx.jsValueFromNapiValue(recv);
177
+ {{{ from64('argv') }}};
178
+ let i;
179
+ let ret;
180
+ try {
181
+ const argList = Array(argc);
182
+ for (i = 0; i < argc; i++) {
183
+ const argVal = {{{ makeGetValue('argv', 'i * ' + POINTER_SIZE, '*') }}};
184
+ argList[i] = emnapiCtx.jsValueFromNapiValue(argVal);
185
+ }
186
+ ret = func.apply(thisArg, argList);
187
+ }
188
+ catch (err) {
189
+ emnapiCtx.isolate.throwException(err);
190
+ return 1;
191
+ }
192
+ return emnapiCtx.napiValueFromJsValue(ret);
193
+ }
194
+ //#endregion src/v8/function.ts
195
+ //#region src/v8/handle_scope.ts
196
+ /**
197
+ * @__deps $emnapiCtx
198
+ * @__sig pp
199
+ */
200
+ function __v8_open_handle_scope(_isolate) {
201
+ return emnapiCtx.isolate.openScope().id;
202
+ }
203
+ /**
204
+ * @__deps $emnapiCtx
205
+ * @__sig v
206
+ */
207
+ function __v8_close_handle_scope() {
208
+ return emnapiCtx.isolate.closeScope();
209
+ }
210
+ /**
211
+ * @__deps $emnapiCtx
212
+ * @__sig ppp
213
+ */
214
+ function __v8_handle_scope_escape(scope, value) {
215
+ const scopeValue = emnapiCtx.getHandleScope(scope);
216
+ {{{ from64('value') }}};
217
+ return scopeValue.escape(value);
218
+ }
219
+ //#endregion src/v8/handle_scope.ts
220
+ //#region src/v8/internal.ts
221
+ /**
222
+ * @__deps $emnapiCtx
223
+ * @__sig pp
224
+ */
225
+ function __v8_local_from_global_reference(ref) {
226
+ const reference = emnapiCtx.isolate.getRef(ref);
227
+ if (reference === undefined)
228
+ return 1;
229
+ const id = reference.slot();
230
+ return id || 1;
231
+ }
232
+ /**
233
+ * @__deps $emnapiCtx
234
+ * @__sig ppp
235
+ */
236
+ function __v8_globalize_reference(isolate, value) {
237
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
238
+ if (jsValue === undefined)
239
+ return 0;
240
+ return emnapiCtx.isolate.createReference(jsValue).id;
241
+ }
242
+ /**
243
+ * @__deps $emnapiCtx
244
+ * @__sig pp
245
+ */
246
+ function __v8_copy_global_reference(from) {
247
+ const ref = emnapiCtx.isolate.getRef(from);
248
+ if (ref === undefined)
249
+ return 0;
250
+ return ref.copy().id;
251
+ }
252
+ /**
253
+ * @__deps $emnapiCtx
254
+ * @__sig vpp
255
+ */
256
+ function __v8_move_global_reference(from, to) {
257
+ const refFrom = emnapiCtx.isolate.getRef(from);
258
+ const refTo = emnapiCtx.isolate.getRef(to);
259
+ if (refFrom === undefined || refTo === undefined)
260
+ return;
261
+ refFrom.move(refTo);
262
+ }
263
+ /**
264
+ * @__deps $emnapiCtx
265
+ * @__sig vp
266
+ */
267
+ function __v8_dispose_global(ref) {
268
+ emnapiCtx.isolate.removeRef(ref);
269
+ }
270
+ /**
271
+ * @__deps $emnapiCtx
272
+ * @__sig vppppi
273
+ */
274
+ function __v8_make_weak(ref, data, callback, weak_callback, type) {
275
+ const refValue = emnapiCtx.isolate.getRef(ref);
276
+ if (!refValue)
277
+ return;
278
+ {{{ from64('callback') }}};
279
+ refValue.setWeak(data, (data) => {
280
+ let field0 = 0;
281
+ let field1 = 0;
282
+ if (type === 1) {
283
+ const id = refValue.slot();
284
+ if (id) {
285
+ const value = emnapiCtx.jsValueFromNapiValue(id);
286
+ field0 = emnapiCtx.isolate.getInternalField(value, 0);
287
+ field1 = emnapiCtx.isolate.getInternalField(value, 1);
288
+ if ((typeof field0 !== 'number' && typeof field0 !== 'bigint') ||
289
+ (typeof field1 !== 'number' && typeof field1 !== 'bigint')) {
290
+ throw new Error('Internal field is not a number');
291
+ }
292
+ }
293
+ }
294
+ {{{ makeDynCall('vppipp', 'callback') }}}(weak_callback, data, type, field0, field1);
295
+ });
296
+ }
297
+ /**
298
+ * @__deps $emnapiCtx
299
+ * @__sig pp
300
+ */
301
+ function __v8_clear_weak(ref) {
302
+ const refValue = emnapiCtx.isolate.getRef(ref);
303
+ if (!refValue)
304
+ return 0;
305
+ refValue.clearWeak();
306
+ return 0;
307
+ }
308
+ //#endregion src/v8/internal.ts
309
+ //#region src/v8/isolate.ts
310
+ /**
311
+ * @__sig p
312
+ */
313
+ function __v8_isolate_get_current_context() {
314
+ return 6 /* Constant.GLOBAL */;
315
+ }
316
+ /**
317
+ * @__deps $emnapiCtx
318
+ * @__sig pp
319
+ */
320
+ function __v8_isolate_throw_exception(error) {
321
+ emnapiCtx.isolate.throwException(emnapiCtx.jsValueFromNapiValue(error));
322
+ return error;
323
+ }
324
+ //#endregion src/v8/isolate.ts
325
+ //#region src/v8/json.ts
326
+ /**
327
+ * @__deps $emnapiCtx
328
+ * @__sig ppp
329
+ */
330
+ function __v8_json_parse(context, json_string) {
331
+ const jsonStringValue = emnapiCtx.jsValueFromNapiValue(json_string);
332
+ try {
333
+ const parsedValue = JSON.parse(jsonStringValue);
334
+ return emnapiCtx.napiValueFromJsValue(parsedValue);
335
+ }
336
+ catch (e) {
337
+ emnapiCtx.isolate.throwException(e);
338
+ return 0;
339
+ }
340
+ }
341
+ /**
342
+ * @__deps $emnapiCtx
343
+ * @__sig pppp
344
+ */
345
+ function __v8_json_stringify(context, json_object, gap) {
346
+ const jsonStringValue = emnapiCtx.jsValueFromNapiValue(json_object);
347
+ try {
348
+ const str = JSON.stringify(jsonStringValue, null, emnapiCtx.jsValueFromNapiValue(gap));
349
+ return emnapiCtx.napiValueFromJsValue(str);
350
+ }
351
+ catch (e) {
352
+ emnapiCtx.isolate.throwException(e);
353
+ return 0;
354
+ }
355
+ }
356
+ //#endregion src/v8/json.ts
357
+ //#region src/v8/number.ts
358
+ /**
359
+ * @__deps $emnapiCtx
360
+ * @__sig dp
361
+ */
362
+ function __v8_number_value(value) {
363
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
364
+ return Number(jsValue);
365
+ }
366
+ /**
367
+ * @__deps $emnapiCtx
368
+ * @__sig vpp
369
+ */
370
+ function __v8_integer_value(value, out) {
371
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
372
+ // Use BigInt if available, else fallback to Number
373
+ let v;
374
+ if (typeof jsValue === 'bigint') {
375
+ v = jsValue;
376
+ }
377
+ else {
378
+ v = Math.trunc(Number(jsValue));
379
+ }
380
+ {{{ from64('out') }}};
381
+ {{{ makeSetValue('out', 0, 'v', 'i64') }}};
382
+ }
383
+ /**
384
+ * @__deps $emnapiCtx
385
+ * @__sig ip
386
+ */
387
+ function __v8_uint32_value(value) {
388
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
389
+ return Number(jsValue) >>> 0;
390
+ }
391
+ /**
392
+ * @__deps $emnapiCtx
393
+ * @__sig ip
394
+ */
395
+ function __v8_int32_value(value) {
396
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
397
+ return Number(jsValue) | 0;
398
+ }
399
+ /**
400
+ * @__deps $emnapiCtx
401
+ * @__sig ppd
402
+ */
403
+ function __v8_number_new(isolate, value) {
404
+ return emnapiCtx.napiValueFromJsValue(value);
405
+ }
406
+ /**
407
+ * @__deps $emnapiCtx
408
+ * @__sig ppi
409
+ */
410
+ function __v8_integer_new(isolate, value) {
411
+ return emnapiCtx.napiValueFromJsValue(value | 0);
412
+ }
413
+ /**
414
+ * @__deps $emnapiCtx
415
+ * @__sig ppi
416
+ */
417
+ function __v8_integer_new_from_unsigned(isolate, value) {
418
+ return emnapiCtx.napiValueFromJsValue(value >>> 0);
419
+ }
420
+ /**
421
+ * @__deps $emnapiCtx
422
+ * @__sig ppd
423
+ */
424
+ function __v8_number_object_new(isolate, value) {
425
+ // eslint-disable-next-line no-new-wrappers
426
+ return emnapiCtx.napiValueFromJsValue(new Number(value));
427
+ }
428
+ //#endregion src/v8/number.ts
429
+ //#region src/v8/object.ts
430
+ /**
431
+ * @__deps $emnapiCtx
432
+ * @__sig ippppp
433
+ */
434
+ function __v8_object_set(obj, context, key, value, success) {
435
+ let r = false;
436
+ try {
437
+ r = Reflect.set(emnapiCtx.jsValueFromNapiValue(obj), emnapiCtx.jsValueFromNapiValue(key), emnapiCtx.jsValueFromNapiValue(value));
438
+ }
439
+ catch (_) {
440
+ return 10;
441
+ }
442
+ {{{ from64('success') }}};
443
+ if (success) {
444
+ const v = r ? 1 : 0;
445
+ {{{ makeSetValue('success', 0, 'v', 'i32') }}};
446
+ }
447
+ return 0;
448
+ }
449
+ /**
450
+ * @__deps $emnapiCtx
451
+ * @__sig ip
452
+ */
453
+ function __v8_object_internal_field_count(obj) {
454
+ const objValue = emnapiCtx.jsValueFromNapiValue(obj);
455
+ return emnapiCtx.isolate.getInternalFieldCount(objValue);
456
+ }
457
+ /**
458
+ * @__deps $emnapiCtx
459
+ * @__sig vpip
460
+ */
461
+ function __v8_object_set_internal_field(obj, index, data) {
462
+ const objValue = emnapiCtx.jsValueFromNapiValue(obj);
463
+ const dataValue = emnapiCtx.jsValueFromNapiValue(data);
464
+ emnapiCtx.isolate.setInternalField(objValue, index, dataValue);
465
+ }
466
+ /**
467
+ * @__deps $emnapiCtx
468
+ * @__sig vpip
469
+ */
470
+ function __v8_object_set_aligned_pointer_in_internal_field(obj, index, data) {
471
+ const objValue = emnapiCtx.jsValueFromNapiValue(obj);
472
+ emnapiCtx.isolate.setInternalField(objValue, index, data);
473
+ }
474
+ /**
475
+ * @__deps $emnapiCtx
476
+ * @__sig pip
477
+ */
478
+ function __v8_object_get_internal_field(obj, index) {
479
+ const objValue = emnapiCtx.jsValueFromNapiValue(obj);
480
+ return emnapiCtx.isolate.napiValueFromJsValue(emnapiCtx.isolate.getInternalField(objValue, index));
481
+ }
482
+ /**
483
+ * @__deps $emnapiCtx
484
+ * @__sig pip
485
+ */
486
+ function __v8_object_get_aligned_pointer_in_internal_field(obj, index) {
487
+ const objValue = emnapiCtx.jsValueFromNapiValue(obj);
488
+ return emnapiCtx.isolate.getInternalField(objValue, index);
489
+ }
490
+ /**
491
+ * @__deps $emnapiCtx
492
+ * @__sig pppp
493
+ */
494
+ function __v8_object_get_key(obj, context, key) {
495
+ const objValue = emnapiCtx.jsValueFromNapiValue(obj);
496
+ if (!objValue)
497
+ return 1;
498
+ return emnapiCtx.napiValueFromJsValue(objValue[emnapiCtx.jsValueFromNapiValue(key)]);
499
+ }
500
+ /**
501
+ * @__deps $emnapiCtx
502
+ * @__sig pppi
503
+ */
504
+ function __v8_object_get_index(obj, context, index) {
505
+ const objValue = emnapiCtx.jsValueFromNapiValue(obj);
506
+ if (!objValue)
507
+ return 1;
508
+ return emnapiCtx.napiValueFromJsValue(objValue[index >>> 0]);
509
+ }
510
+ /**
511
+ * @__deps $emnapiCtx
512
+ * @__sig ppp
513
+ */
514
+ function __v8_private_for_api(isolate, name) {
515
+ const n = emnapiCtx.isolate.getOrCreateGlobalPrivate(emnapiCtx.jsValueFromNapiValue(name));
516
+ return emnapiCtx.napiValueFromJsValue(n);
517
+ }
518
+ /**
519
+ * @__deps $emnapiCtx
520
+ * @__sig ippppp
521
+ */
522
+ function __v8_object_set_private(obj, context, key, value, success) {
523
+ if (emnapiCtx.isolate.hasPendingException())
524
+ return 1;
525
+ const o = emnapiCtx.jsValueFromNapiValue(obj);
526
+ const k = emnapiCtx.jsValueFromNapiValue(key);
527
+ const v = emnapiCtx.jsValueFromNapiValue(value);
528
+ try {
529
+ emnapiCtx.isolate.setPrivate(o, k, v);
530
+ }
531
+ catch (err) {
532
+ emnapiCtx.isolate.throwException(err);
533
+ return 1;
534
+ }
535
+ {{{ from64('success') }}};
536
+ if (success) {
537
+ const vv = 1;
538
+ {{{ makeSetValue('success', 0, 'vv', 'i32') }}};
539
+ }
540
+ return 0;
541
+ }
542
+ /**
543
+ * @__deps $emnapiCtx
544
+ * @__sig ipppp
545
+ */
546
+ function __v8_object_has_private(obj, context, key, has) {
547
+ if (emnapiCtx.isolate.hasPendingException())
548
+ return 1;
549
+ const o = emnapiCtx.jsValueFromNapiValue(obj);
550
+ const k = emnapiCtx.jsValueFromNapiValue(key);
551
+ let v;
552
+ try {
553
+ v = emnapiCtx.isolate.hasPrivate(o, k) ? 1 : 0;
554
+ }
555
+ catch (err) {
556
+ emnapiCtx.isolate.throwException(err);
557
+ return 1;
558
+ }
559
+ {{{ from64('has') }}};
560
+ if (has)
561
+ {{{ makeSetValue('has', 0, 'v', 'i32') }}};
562
+ return 0;
563
+ }
564
+ /**
565
+ * @__deps $emnapiCtx
566
+ * @__sig pppp
567
+ */
568
+ function __v8_object_get_private(obj, context, key) {
569
+ if (emnapiCtx.isolate.hasPendingException())
570
+ return 1;
571
+ const o = emnapiCtx.jsValueFromNapiValue(obj);
572
+ const k = emnapiCtx.jsValueFromNapiValue(key);
573
+ try {
574
+ const v = emnapiCtx.isolate.getPrivate(o, k);
575
+ return emnapiCtx.napiValueFromJsValue(v);
576
+ }
577
+ catch (err) {
578
+ emnapiCtx.isolate.throwException(err);
579
+ return 1;
580
+ }
581
+ }
582
+ /**
583
+ * @__deps $emnapiCtx
584
+ * @__sig ipppp
585
+ */
586
+ function __v8_object_delete_private(obj, context, key, success) {
587
+ if (emnapiCtx.isolate.hasPendingException())
588
+ return 1;
589
+ const o = emnapiCtx.jsValueFromNapiValue(obj);
590
+ const k = emnapiCtx.jsValueFromNapiValue(key);
591
+ let r;
592
+ try {
593
+ r = emnapiCtx.isolate.deletePrivate(o, k);
594
+ }
595
+ catch (err) {
596
+ emnapiCtx.isolate.throwException(err);
597
+ return 1;
598
+ }
599
+ {{{ from64('success') }}};
600
+ if (success) {
601
+ const vv = r ? 1 : 0;
602
+ {{{ makeSetValue('success', 0, 'vv', 'i32') }}};
603
+ }
604
+ return 0;
605
+ }
606
+ /**
607
+ * @__deps $emnapiCtx
608
+ * @__sig pp
609
+ */
610
+ function __v8_object_new(isolate) {
611
+ return emnapiCtx.napiValueFromJsValue({});
612
+ }
613
+ //#endregion src/v8/object.ts
614
+ //#region src/v8/script.ts
615
+ /**
616
+ * @__deps $emnapiCtx
617
+ * @__sig pppii
618
+ */
619
+ function __v8_script_compiler_compile_unbound_script(isolate, sourceString, options, reason) {
620
+ const str = emnapiCtx.jsValueFromNapiValue(sourceString);
621
+ if (!str)
622
+ return 1;
623
+ return emnapiCtx.napiValueFromJsValue(str);
624
+ }
625
+ /**
626
+ * @__deps $emnapiCtx
627
+ * @__sig pp
628
+ */
629
+ function __v8_unbound_script_bind_to_current_context(unboundScript) {
630
+ const str = emnapiCtx.jsValueFromNapiValue(unboundScript);
631
+ if (!str)
632
+ return 1;
633
+ return emnapiCtx.napiValueFromJsValue(str);
634
+ }
635
+ /**
636
+ * @__deps $emnapiCtx
637
+ * @__sig ppp
638
+ */
639
+ function __v8_script_run(script, context) {
640
+ if (emnapiCtx.isolate.hasPendingException())
641
+ return 1;
642
+ const str = emnapiCtx.jsValueFromNapiValue(script);
643
+ const g = emnapiCtx.jsValueFromNapiValue(context);
644
+ let ret;
645
+ try {
646
+ ret = g.eval(str);
647
+ }
648
+ catch (err) {
649
+ emnapiCtx.isolate.throwException(err);
650
+ return 1;
651
+ }
652
+ return emnapiCtx.napiValueFromJsValue(ret);
653
+ }
654
+ //#endregion src/v8/script.ts
655
+ //#region src/v8/string.ts
656
+ /**
657
+ * @__deps $emnapiCtx
658
+ * @__deps $emnapiString
659
+ * @__sig pppii
660
+ */
661
+ function __v8_string_new_from_utf8(isolate, data, type, length) {
662
+ {{{ from64('data') }}};
663
+ {{{ from64('length') }}};
664
+ const str = emnapiString.UTF8ToString(data, length);
665
+ return emnapiCtx.napiValueFromJsValue(str);
666
+ }
667
+ /**
668
+ * @__deps $emnapiCtx
669
+ * @__sig ppp
670
+ */
671
+ function __v8_string_object_new(isolate, value) {
672
+ // eslint-disable-next-line no-new-wrappers
673
+ return emnapiCtx.napiValueFromJsValue(new String(emnapiCtx.jsValueFromNapiValue(value)));
674
+ }
675
+ /**
676
+ * @__deps $emnapiCtx
677
+ * @__sig pp
678
+ */
679
+ function __v8_string_object_value_of(self) {
680
+ const strObj = emnapiCtx.jsValueFromNapiValue(self);
681
+ return emnapiCtx.napiValueFromJsValue(strObj.valueOf());
682
+ }
683
+ /**
684
+ * @__deps $emnapiCtx
685
+ * @__deps $emnapiString
686
+ * @__sig pppii
687
+ */
688
+ function __v8_string_new_from_one_byte(isolate, data, type, length) {
689
+ {{{ from64('data') }}};
690
+ {{{ from64('length') }}};
691
+ const str = emnapiString.encode(data, length === -1 || length === 4294967295, length >>> 0, (c) => String.fromCharCode(c));
692
+ return emnapiCtx.napiValueFromJsValue(str);
693
+ }
694
+ /**
695
+ * @__deps $emnapiCtx
696
+ * @__deps $emnapiString
697
+ * @__sig pppii
698
+ */
699
+ function __v8_string_new_from_two_byte(isolate, data, type, length) {
700
+ {{{ from64('data') }}};
701
+ {{{ from64('length') }}};
702
+ const str = emnapiString.UTF16ToString(data, length);
703
+ return emnapiCtx.napiValueFromJsValue(str);
704
+ }
705
+ /**
706
+ * @__deps $emnapiCtx
707
+ * @__deps $emnapiString
708
+ * @__sig pppi
709
+ */
710
+ function __v8_string_new_external_one_byte(isolate, data, length) {
711
+ {{{ from64('data') }}};
712
+ {{{ from64('length') }}};
713
+ const str = emnapiString.encode(data, length === -1 || length === 4294967295, length >>> 0, (c) => String.fromCharCode(c));
714
+ return emnapiCtx.napiValueFromJsValue(str);
715
+ }
716
+ /**
717
+ * @__deps $emnapiCtx
718
+ * @__deps $emnapiString
719
+ * @__sig pppi
720
+ */
721
+ function __v8_string_new_external_two_byte(isolate, data, length) {
722
+ {{{ from64('data') }}};
723
+ {{{ from64('length') }}};
724
+ const str = emnapiString.UTF16ToString(data, length);
725
+ return emnapiCtx.napiValueFromJsValue(str);
726
+ }
727
+ /**
728
+ * @__deps $emnapiCtx
729
+ * @__sig pppi
730
+ */
731
+ function __v8_regex_new(context, pattern, flags) {
732
+ {{{ from64('pattern') }}};
733
+ const str = emnapiCtx.jsValueFromNapiValue(pattern);
734
+ let f = '';
735
+ if (flags & 1)
736
+ f += 'g';
737
+ if (flags & 2)
738
+ f += 'i';
739
+ if (flags & 4)
740
+ f += 'm';
741
+ if (flags & 8)
742
+ f += 'y';
743
+ if (flags & 16)
744
+ f += 'u';
745
+ if (flags & 32)
746
+ f += 's';
747
+ return emnapiCtx.napiValueFromJsValue(f ? new RegExp(str, f) : new RegExp(str));
748
+ }
749
+ /**
750
+ * @__deps $emnapiCtx
751
+ * @__deps $emnapiString
752
+ * @__sig ipp
753
+ */
754
+ function __v8_string_utf8_length(str, isolate) {
755
+ const jsValue = emnapiCtx.jsValueFromNapiValue(str);
756
+ if (jsValue === undefined)
757
+ return 0;
758
+ if (typeof jsValue !== 'string')
759
+ return 0;
760
+ return emnapiString.lengthBytesUTF8(jsValue);
761
+ }
762
+ /**
763
+ * @__deps $emnapiCtx
764
+ * @__sig ip
765
+ */
766
+ function __v8_string_length(str) {
767
+ const jsValue = emnapiCtx.jsValueFromNapiValue(str);
768
+ if (jsValue === undefined)
769
+ return 0;
770
+ if (typeof jsValue !== 'string')
771
+ return 0;
772
+ return jsValue.length;
773
+ }
774
+ /**
775
+ * @__deps $emnapiCtx
776
+ * @__deps $emnapiString
777
+ * @__sig ipppipi
778
+ */
779
+ function __v8_string_write_utf8(str, isolate, buffer, length, nchars_ref, options) {
780
+ {{{ from64('buffer') }}};
781
+ {{{ from64('nchars_ref') }}};
782
+ const jsValue = emnapiCtx.jsValueFromNapiValue(str);
783
+ if (jsValue === undefined || typeof jsValue !== 'string') {
784
+ if (nchars_ref) {
785
+ {{{ makeSetValue('nchars_ref', 0, '0', 'i32') }}};
786
+ }
787
+ return 0;
788
+ }
789
+ const written = emnapiString.stringToUTF8(jsValue, buffer, length);
790
+ if (nchars_ref) {
791
+ {{{ makeSetValue('nchars_ref', 0, 'written', 'i32') }}};
792
+ }
793
+ return written;
794
+ }
795
+ //#endregion src/v8/string.ts
796
+ //#region src/v8/template.ts
797
+ /**
798
+ * @__deps $emnapiCtx
799
+ * @__sig ippppp
800
+ */
801
+ function __v8_get_cb_info(cbinfo, argc, argv, this_arg, data) {
802
+ if (!cbinfo)
803
+ return 1;
804
+ const cbinfoValue = emnapiCtx.getCallbackInfo(cbinfo);
805
+ {{{ from64('argc') }}};
806
+ {{{ from64('argv') }}};
807
+ if (argv) {
808
+ if (!argc)
809
+ return 1;
810
+ let argcValue = {{{ makeGetValue('argc', 0, SIZE_TYPE) }}};
811
+ {{{ from64('argcValue') }}};
812
+ const len = cbinfoValue.args.length;
813
+ const arrlen = argcValue < len ? argcValue : len;
814
+ let i = 0;
815
+ for (; i < arrlen; i++) {
816
+ const argVal = emnapiCtx.napiValueFromJsValue(cbinfoValue.args[i]);
817
+ {{{ makeSetValue('argv', 'i * ' + POINTER_SIZE, 'argVal', '*') }}};
818
+ }
819
+ if (i < argcValue) {
820
+ for (; i < argcValue; i++) {
821
+ {{{ makeSetValue('argv', 'i * ' + POINTER_SIZE, '1', '*') }}};
822
+ }
823
+ }
824
+ }
825
+ if (argc) {
826
+ {{{ makeSetValue('argc', 0, 'cbinfoValue.args.length', SIZE_TYPE) }}};
827
+ }
828
+ if (this_arg) {
829
+ {{{ from64('this_arg') }}};
830
+ const v = emnapiCtx.napiValueFromJsValue(cbinfoValue.thiz);
831
+ {{{ makeSetValue('this_arg', 0, 'v', '*') }}};
832
+ }
833
+ if (data) {
834
+ {{{ from64('data') }}};
835
+ const localData = emnapiCtx.napiValueFromJsValue(cbinfoValue.data);
836
+ {{{ makeSetValue('data', 0, 'localData', '*') }}};
837
+ }
838
+ return 0;
839
+ }
840
+ /**
841
+ * @__deps $emnapiCtx
842
+ * @__sig ppppppiiipiii
843
+ */
844
+ function __v8_function_template_new(isolate, callback, cb, data, signature, length, behavior, side_effect_type, c_function, instance_type, allowed_receiver_instance_type_range_start, allowed_receiver_instance_type_range_end) {
845
+ const jsCb = {{{ makeDynCall('ppp', 'callback') }}};
846
+ const tpl = emnapiCtx.isolate.createFunctionTemplate(jsCb, cb, emnapiCtx.jsValueFromNapiValue(data), emnapiCtx.jsValueFromNapiValue(signature));
847
+ return emnapiCtx.napiValueFromJsValue(tpl);
848
+ }
849
+ /**
850
+ * @__deps $emnapiCtx
851
+ * @__sig pppppiii
852
+ */
853
+ function __v8_function_new(context, callback, cb, data, length, behavior, side_effect_type) {
854
+ const jsCb = {{{ makeDynCall('ppp', 'callback') }}};
855
+ const tpl = emnapiCtx.isolate.createFunctionTemplate(jsCb, cb, emnapiCtx.jsValueFromNapiValue(data), undefined);
856
+ const func = tpl.getFunction();
857
+ return emnapiCtx.napiValueFromJsValue(func);
858
+ }
859
+ /**
860
+ * @__deps $emnapiCtx
861
+ * @__sig pp
862
+ */
863
+ function __v8_cbinfo_holder(info) {
864
+ const cbinfoValue = emnapiCtx.getCallbackInfo(info);
865
+ const { holder } = cbinfoValue;
866
+ return emnapiCtx.napiValueFromJsValue(holder);
867
+ }
868
+ /**
869
+ * @__deps $emnapiCtx
870
+ * @__sig pp
871
+ */
872
+ function __v8_cbinfo_new_target(info) {
873
+ const cbinfoValue = emnapiCtx.getCallbackInfo(info);
874
+ const { thiz, fn } = cbinfoValue;
875
+ const value = thiz == null || thiz.constructor == null
876
+ ? 0
877
+ : thiz instanceof fn
878
+ ? emnapiCtx.napiValueFromJsValue(thiz.constructor)
879
+ : 0;
880
+ return value;
881
+ }
882
+ /**
883
+ * @__deps $emnapiCtx
884
+ * @__sig ppp
885
+ */
886
+ function __v8_function_template_get_function(template, context) {
887
+ const tpl = emnapiCtx.jsValueFromNapiValue(template);
888
+ if (!tpl)
889
+ return 0;
890
+ return emnapiCtx.napiValueFromJsValue(tpl.getFunction());
891
+ }
892
+ function __v8_function_template_set_class_name(template, name) {
893
+ const tpl = emnapiCtx.jsValueFromNapiValue(template);
894
+ const nameValue = emnapiCtx.jsValueFromNapiValue(name);
895
+ if (!tpl || nameValue == null)
896
+ return;
897
+ tpl.setClassName(nameValue);
898
+ }
899
+ /**
900
+ * @__deps $emnapiCtx
901
+ * @__sig ppp
902
+ */
903
+ function __v8_object_template_new(isolate, constructor) {
904
+ const tpl = emnapiCtx.isolate.createObjectTemplate(emnapiCtx.jsValueFromNapiValue(constructor));
905
+ return emnapiCtx.napiValueFromJsValue(tpl);
906
+ }
907
+ /**
908
+ * @__deps $emnapiCtx
909
+ * @__sig vpi
910
+ */
911
+ function __v8_object_template_set_internal_field_count(tpl, value) {
912
+ const templateObject = emnapiCtx.jsValueFromNapiValue(tpl);
913
+ templateObject.setInternalFieldCount(value);
914
+ }
915
+ /**
916
+ * @__deps $emnapiCtx
917
+ * @__sig ppp
918
+ */
919
+ function __v8_object_template_new_instance(obj_tpl, context) {
920
+ if (emnapiCtx.isolate.hasPendingException())
921
+ return 1;
922
+ const objTemplate = emnapiCtx.jsValueFromNapiValue(obj_tpl);
923
+ return emnapiCtx.napiValueFromJsValue(objTemplate.newInstance(context));
924
+ }
925
+ /**
926
+ * @__deps $emnapiCtx
927
+ * @__sig ppp
928
+ */
929
+ function __v8_signature_new(isolate, receiver) {
930
+ const rcv = emnapiCtx.jsValueFromNapiValue(receiver);
931
+ const sig = emnapiCtx.isolate.createSignature(rcv);
932
+ return emnapiCtx.napiValueFromJsValue(sig);
933
+ }
934
+ /**
935
+ * @__deps $emnapiCtx
936
+ * @__sig vpppi
937
+ */
938
+ function __v8_template_set(tpl, name, value, attr) {
939
+ const templateObject = emnapiCtx.jsValueFromNapiValue(tpl);
940
+ if (!templateObject)
941
+ return;
942
+ const nameValue = emnapiCtx.jsValueFromNapiValue(name);
943
+ const valueValue = emnapiCtx.jsValueFromNapiValue(value);
944
+ if (nameValue == null)
945
+ return;
946
+ templateObject.set(nameValue, valueValue, attr);
947
+ }
948
+ /**
949
+ * @__deps $emnapiCtx
950
+ * @__sig pp
951
+ */
952
+ function __v8_function_template_instance_template(tpl) {
953
+ const templateObject = emnapiCtx.jsValueFromNapiValue(tpl);
954
+ if (!templateObject)
955
+ return 1;
956
+ return emnapiCtx.napiValueFromJsValue(templateObject.instanceTemplate());
957
+ }
958
+ /**
959
+ * @__deps $emnapiCtx
960
+ * @__sig pp
961
+ */
962
+ function __v8_function_template_prototype_template(tpl) {
963
+ const templateObject = emnapiCtx.jsValueFromNapiValue(tpl);
964
+ if (!templateObject)
965
+ return 1;
966
+ return emnapiCtx.napiValueFromJsValue(templateObject.prototypeTemplate());
967
+ }
968
+ /**
969
+ * @__deps $emnapiCtx
970
+ * @__sig vpp
971
+ */
972
+ function __v8_get_property_cb_info(cbinfo, args) {
973
+ if (!cbinfo)
974
+ return;
975
+ const cbinfoValue = emnapiCtx.getCallbackInfo(cbinfo);
976
+ /**
977
+ * static constexpr int kShouldThrowOnErrorIndex = 0;
978
+ * static constexpr int kHolderIndex = 1;
979
+ * static constexpr int kIsolateIndex = 2;
980
+ * static constexpr int kUnusedIndex = 3;
981
+ * static constexpr int kReturnValueIndex = 4;
982
+ * static constexpr int kDataIndex = 5;
983
+ * static constexpr int kThisIndex = 6;
984
+ * static constexpr int kArgsLength = 7;
985
+ */
986
+ {{{ from64('args') }}};
987
+ const thiz = emnapiCtx.napiValueFromJsValue(cbinfoValue.thiz);
988
+ const holder = emnapiCtx.napiValueFromJsValue(cbinfoValue.holder);
989
+ {{{ makeSetValue('args', '1 * ' + POINTER_SIZE, 'holder', '*') }}};
990
+ {{{ makeSetValue('args', '6 * ' + POINTER_SIZE, 'thiz', '*') }}};
991
+ const localData = emnapiCtx.napiValueFromJsValue(cbinfoValue.data);
992
+ {{{ makeSetValue('args', '5 * ' + POINTER_SIZE, 'localData', '*') }}};
993
+ }
994
+ /**
995
+ * @__deps $emnapiCtx
996
+ * @__sig vpppppppiii
997
+ */
998
+ function __v8_object_template_set_accessor(tpl, name, getter_wrap, setter_wrap, getter, setter, data, attribute, getter_side_effect_type, setter_side_effect_type) {
999
+ const templateObject = emnapiCtx.jsValueFromNapiValue(tpl);
1000
+ if (!templateObject)
1001
+ return;
1002
+ const nameValue = emnapiCtx.jsValueFromNapiValue(name);
1003
+ {{{ from64('getter_wrap') }}};
1004
+ {{{ from64('setter_wrap') }}};
1005
+ const getterWrap = {{{ makeDynCall('pppp', 'getter_wrap') }}};
1006
+ const setterWrap = {{{ makeDynCall('ppppp', 'setter_wrap') }}};
1007
+ templateObject.setAccessor(nameValue, getterWrap, setterWrap, getter, setter, emnapiCtx.jsValueFromNapiValue(data), attribute, getter_side_effect_type, setter_side_effect_type);
1008
+ }
1009
+ //#endregion src/v8/template.ts
1010
+ //#region src/v8/try_catch.ts
1011
+ /**
1012
+ * @__deps $emnapiCtx
1013
+ * @__sig vp
1014
+ */
1015
+ function __v8_trycatch_construct(tc) {
1016
+ emnapiCtx.isolate.pushTryCatch(tc);
1017
+ }
1018
+ /**
1019
+ * @__deps $emnapiCtx
1020
+ * @__sig vp
1021
+ */
1022
+ function __v8_trycatch_destruct(tc) {
1023
+ emnapiCtx.isolate.popTryCatch(tc);
1024
+ }
1025
+ /**
1026
+ * @__deps $emnapiCtx
1027
+ * @__sig ip
1028
+ */
1029
+ function __v8_trycatch_has_caught(tc) {
1030
+ const tryCatch = emnapiCtx.isolate.getTryCatch(tc);
1031
+ if (!tryCatch)
1032
+ return 0;
1033
+ return Number(tryCatch.hasCaught());
1034
+ }
1035
+ /**
1036
+ * @__deps $emnapiCtx
1037
+ * @__sig pp
1038
+ */
1039
+ function __v8_trycatch_rethrow(tc) {
1040
+ const tryCatch = emnapiCtx.isolate.getTryCatch(tc);
1041
+ if (!tryCatch)
1042
+ return 1;
1043
+ const e = tryCatch.rethrow(emnapiCtx.isolate);
1044
+ if (e === undefined)
1045
+ return 1;
1046
+ return emnapiCtx.napiValueFromJsValue(e);
1047
+ }
1048
+ /**
1049
+ * @__deps $emnapiCtx
1050
+ * @__sig pp
1051
+ */
1052
+ function __v8_trycatch_exception(tc) {
1053
+ const tryCatch = emnapiCtx.isolate.getTryCatch(tc);
1054
+ if (!tryCatch || !tryCatch.hasCaught())
1055
+ return 1;
1056
+ return emnapiCtx.napiValueFromJsValue(tryCatch.exception());
1057
+ }
1058
+ /**
1059
+ * @__deps $emnapiCtx
1060
+ * @__sig vp
1061
+ */
1062
+ function __v8_trycatch_reset(tc) {
1063
+ const tryCatch = emnapiCtx.isolate.getTryCatch(tc);
1064
+ if (!tryCatch)
1065
+ return;
1066
+ tryCatch.reset();
1067
+ }
1068
+ //#endregion src/v8/try_catch.ts
1069
+ //#region src/v8/value.ts
1070
+ /**
1071
+ * @__deps $emnapiCtx
1072
+ * @__sig ipp
1073
+ */
1074
+ function __v8_value_strict_equals(value, that) {
1075
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
1076
+ const jsThat = emnapiCtx.jsValueFromNapiValue(that);
1077
+ return Object.is(jsValue, jsThat) ? 1 : 0;
1078
+ }
1079
+ /**
1080
+ * @__deps $emnapiCtx
1081
+ * @__sig ppp
1082
+ */
1083
+ function __v8_value_to_boolean(value, isolate) {
1084
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
1085
+ const boolValue = Boolean(jsValue);
1086
+ return emnapiCtx.napiValueFromJsValue(boolValue);
1087
+ }
1088
+ /**
1089
+ * @__deps $emnapiCtx
1090
+ * @__sig ppp
1091
+ */
1092
+ function __v8_value_to_number(value, context) {
1093
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
1094
+ const numValue = Number(jsValue);
1095
+ return emnapiCtx.napiValueFromJsValue(numValue);
1096
+ }
1097
+ /**
1098
+ * @__deps $emnapiCtx
1099
+ * @__sig ppp
1100
+ */
1101
+ function __v8_value_to_string(value, context) {
1102
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
1103
+ const strValue = String(jsValue);
1104
+ return emnapiCtx.napiValueFromJsValue(strValue);
1105
+ }
1106
+ /**
1107
+ * @__deps $emnapiCtx
1108
+ * @__sig ppp
1109
+ */
1110
+ function __v8_value_to_object(value, context) {
1111
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
1112
+ if (jsValue === null || jsValue === undefined)
1113
+ return 0;
1114
+ const objValue = Object(jsValue);
1115
+ return emnapiCtx.napiValueFromJsValue(objValue);
1116
+ }
1117
+ /**
1118
+ * @__deps $emnapiCtx
1119
+ * @__sig ppp
1120
+ */
1121
+ function __v8_value_to_integer(value, context) {
1122
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
1123
+ const intValue = Math.trunc(Number(jsValue));
1124
+ return emnapiCtx.napiValueFromJsValue(intValue);
1125
+ }
1126
+ /**
1127
+ * @__deps $emnapiCtx
1128
+ * @__sig ppp
1129
+ */
1130
+ function __v8_value_to_uint32(value, context) {
1131
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
1132
+ const uint32Value = Number(jsValue) >>> 0;
1133
+ return emnapiCtx.napiValueFromJsValue(uint32Value);
1134
+ }
1135
+ /**
1136
+ * @__deps $emnapiCtx
1137
+ * @__sig ppp
1138
+ */
1139
+ function __v8_value_to_int32(value, context) {
1140
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
1141
+ const int32Value = Number(jsValue) | 0;
1142
+ return emnapiCtx.napiValueFromJsValue(int32Value);
1143
+ }
1144
+ /**
1145
+ * @__deps $emnapiCtx
1146
+ * @__sig ppp
1147
+ */
1148
+ function __v8_value_to_array_index(value, context) {
1149
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
1150
+ // V8: ToArrayIndex returns uint32 if possible, else undefined
1151
+ const n = Number(jsValue);
1152
+ if (typeof n === 'number' &&
1153
+ isFinite(n) &&
1154
+ n >= 0 &&
1155
+ n <= 0xffffffff &&
1156
+ Math.floor(n) === n) {
1157
+ return emnapiCtx.napiValueFromJsValue(n >>> 0);
1158
+ }
1159
+ return 0;
1160
+ }
1161
+ /**
1162
+ * @__deps $emnapiCtx
1163
+ * @__sig ip
1164
+ */
1165
+ function __v8_value_is_function(value) {
1166
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
1167
+ if (jsValue == null)
1168
+ return 0;
1169
+ const isFunction = typeof jsValue === 'function';
1170
+ return isFunction ? 1 : 0;
1171
+ }
1172
+ /**
1173
+ * @__deps $emnapiCtx
1174
+ * @__sig ip
1175
+ */
1176
+ function __v8_value_is_number(value) {
1177
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
1178
+ if (jsValue == null)
1179
+ return 0;
1180
+ const isFunction = typeof jsValue === 'number';
1181
+ return isFunction ? 1 : 0;
1182
+ }
1183
+ /**
1184
+ * @__deps $emnapiCtx
1185
+ * @__sig ip
1186
+ */
1187
+ function __v8_value_is_undefined(value) {
1188
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
1189
+ const isUndefined = jsValue === undefined;
1190
+ return isUndefined ? 1 : 0;
1191
+ }
1192
+ /**
1193
+ * @__deps $emnapiCtx
1194
+ * @__sig ip
1195
+ */
1196
+ function __v8_value_is_null(value) {
1197
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
1198
+ const isUndefined = jsValue === null;
1199
+ return isUndefined ? 1 : 0;
1200
+ }
1201
+ /**
1202
+ * @__deps $emnapiCtx
1203
+ * @__sig ip
1204
+ */
1205
+ function __v8_value_is_true(value) {
1206
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
1207
+ if (jsValue == null)
1208
+ return 0;
1209
+ const isUndefined = jsValue === true;
1210
+ return isUndefined ? 1 : 0;
1211
+ }
1212
+ /**
1213
+ * @__deps $emnapiCtx
1214
+ * @__sig ip
1215
+ */
1216
+ function __v8_value_is_false(value) {
1217
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
1218
+ if (jsValue == null)
1219
+ return 0;
1220
+ const isUndefined = jsValue === false;
1221
+ return isUndefined ? 1 : 0;
1222
+ }
1223
+ /**
1224
+ * @__deps $emnapiCtx
1225
+ * @__sig ip
1226
+ */
1227
+ function __v8_value_is_string(value) {
1228
+ const jsValue = emnapiCtx.jsValueFromNapiValue(value);
1229
+ if (jsValue == null)
1230
+ return 0;
1231
+ const isFunction = typeof jsValue === 'string';
1232
+ return isFunction ? 1 : 0;
1233
+ }
1234
+ //#endregion src/v8/value.ts
1235
+ //#region src/v8/node.ts
1236
+ /**
1237
+ * @__deps $emnapiCtx
1238
+ * @__deps $emnapiString
1239
+ * @__sig ppppi
1240
+ */
1241
+ function __node_encode(isolate, buf, len, encoding) {
1242
+ const autoLength = len === -1 || len === 4294967295;
1243
+ {{{ from64('buf') }}};
1244
+ {{{ from64('len') }}};
1245
+ if (encoding === 1) {
1246
+ return emnapiCtx.napiValueFromJsValue(emnapiString.UTF8ToString(buf, len));
1247
+ }
1248
+ if (encoding === -1) {
1249
+ return emnapiCtx.napiValueFromJsValue(emnapiString.UTF16ToString(buf, len));
1250
+ }
1251
+ if (encoding === 2) {
1252
+ const Buffer = emnapiCtx.features.Buffer;
1253
+ if (typeof Buffer !== 'function') {
1254
+ emnapiCtx.isolate.throwException(new Error('Buffer is not supported'));
1255
+ return 1;
1256
+ }
1257
+ const buffer = Buffer.from(wasmMemory.buffer, buf, len >>> 0);
1258
+ return emnapiCtx.napiValueFromJsValue(buffer.toString('base64'));
1259
+ }
1260
+ if (encoding === 3) {
1261
+ return emnapiCtx.napiValueFromJsValue(emnapiString.UTF16ToString(buf, len / 2));
1262
+ }
1263
+ if (encoding === 4 || encoding === 0) {
1264
+ return emnapiCtx.napiValueFromJsValue(emnapiString.encode(buf, autoLength, len >>> 0, (c) => String.fromCharCode(c)));
1265
+ }
1266
+ if (encoding === 5) {
1267
+ return emnapiCtx.napiValueFromJsValue(emnapiString.encode(buf, autoLength, len >>> 0, (c) => c.toString(16).padStart(2, '0')));
1268
+ }
1269
+ if (encoding === 6) {
1270
+ const Buffer = emnapiCtx.features.Buffer;
1271
+ if (typeof Buffer !== 'function') {
1272
+ emnapiCtx.isolate.throwException(new Error('Buffer is not supported'));
1273
+ return 1;
1274
+ }
1275
+ const buffer = Buffer.from(wasmMemory.buffer, buf, len >>> 0);
1276
+ return emnapiCtx.napiValueFromJsValue(buffer);
1277
+ }
1278
+ emnapiCtx.isolate.throwException(new Error(`Unsupported encoding: ${encoding}`));
1279
+ return 1;
1280
+ }
1281
+ (typeof addToLibrary === "function" ? addToLibrary : (...args) => mergeInto(LibraryManager.library, ...args))({
1282
+ _node_encode: __node_encode,
1283
+ _node_encode__deps: ["$emnapiCtx", "$emnapiString"],
1284
+ _node_encode__sig: "ppppi",
1285
+ _v8_array_length: __v8_array_length,
1286
+ _v8_array_length__deps: ["$emnapiCtx"],
1287
+ _v8_array_length__sig: "ip",
1288
+ _v8_array_new: __v8_array_new,
1289
+ _v8_array_new__deps: ["$emnapiCtx"],
1290
+ _v8_array_new__sig: "ppi",
1291
+ _v8_boolean_object_new: __v8_boolean_object_new,
1292
+ _v8_boolean_object_new__deps: ["$emnapiCtx"],
1293
+ _v8_boolean_object_new__sig: "ppi",
1294
+ _v8_boolean_object_value_of: __v8_boolean_object_value_of,
1295
+ _v8_boolean_object_value_of__deps: ["$emnapiCtx"],
1296
+ _v8_boolean_object_value_of__sig: "ip",
1297
+ _v8_boolean_value: __v8_boolean_value,
1298
+ _v8_boolean_value__deps: ["$emnapiCtx"],
1299
+ _v8_boolean_value__sig: "ip",
1300
+ _v8_cbinfo_holder: __v8_cbinfo_holder,
1301
+ _v8_cbinfo_holder__deps: ["$emnapiCtx"],
1302
+ _v8_cbinfo_holder__sig: "pp",
1303
+ _v8_cbinfo_new_target: __v8_cbinfo_new_target,
1304
+ _v8_cbinfo_new_target__deps: ["$emnapiCtx"],
1305
+ _v8_cbinfo_new_target__sig: "pp",
1306
+ _v8_clear_weak: __v8_clear_weak,
1307
+ _v8_clear_weak__deps: ["$emnapiCtx"],
1308
+ _v8_clear_weak__sig: "pp",
1309
+ _v8_close_handle_scope: __v8_close_handle_scope,
1310
+ _v8_close_handle_scope__deps: ["$emnapiCtx"],
1311
+ _v8_close_handle_scope__sig: "v",
1312
+ _v8_copy_global_reference: __v8_copy_global_reference,
1313
+ _v8_copy_global_reference__deps: ["$emnapiCtx"],
1314
+ _v8_copy_global_reference__sig: "pp",
1315
+ _v8_date_new: __v8_date_new,
1316
+ _v8_date_new__deps: ["$emnapiCtx"],
1317
+ _v8_date_new__sig: "ppd",
1318
+ _v8_dispose_global: __v8_dispose_global,
1319
+ _v8_dispose_global__deps: ["$emnapiCtx"],
1320
+ _v8_dispose_global__sig: "vp",
1321
+ _v8_exception_error: __v8_exception_error,
1322
+ _v8_exception_error__deps: ["$emnapiCtx"],
1323
+ _v8_exception_error__sig: "ppp",
1324
+ _v8_exception_range_error: __v8_exception_range_error,
1325
+ _v8_exception_range_error__deps: ["$emnapiCtx"],
1326
+ _v8_exception_range_error__sig: "ppp",
1327
+ _v8_exception_reference_error: __v8_exception_reference_error,
1328
+ _v8_exception_reference_error__deps: ["$emnapiCtx"],
1329
+ _v8_exception_reference_error__sig: "ppp",
1330
+ _v8_exception_syntax_error: __v8_exception_syntax_error,
1331
+ _v8_exception_syntax_error__deps: ["$emnapiCtx"],
1332
+ _v8_exception_syntax_error__sig: "ppp",
1333
+ _v8_exception_type_error: __v8_exception_type_error,
1334
+ _v8_exception_type_error__deps: ["$emnapiCtx"],
1335
+ _v8_exception_type_error__sig: "ppp",
1336
+ _v8_external_new: __v8_external_new,
1337
+ _v8_external_new__deps: ["$emnapiCtx"],
1338
+ _v8_external_new__sig: "ppp",
1339
+ _v8_external_value: __v8_external_value,
1340
+ _v8_external_value__deps: ["$emnapiCtx"],
1341
+ _v8_external_value__sig: "pp",
1342
+ _v8_function_call: __v8_function_call,
1343
+ _v8_function_call__deps: ["$emnapiCtx"],
1344
+ _v8_function_call__sig: "ppppip",
1345
+ _v8_function_new: __v8_function_new,
1346
+ _v8_function_new__deps: ["$emnapiCtx"],
1347
+ _v8_function_new__sig: "pppppiii",
1348
+ _v8_function_new_instance: __v8_function_new_instance,
1349
+ _v8_function_new_instance__deps: ["$emnapiCtx"],
1350
+ _v8_function_new_instance__sig: "ppppp",
1351
+ _v8_function_set_name: __v8_function_set_name,
1352
+ _v8_function_set_name__deps: ["$emnapiCtx"],
1353
+ _v8_function_set_name__sig: "vpp",
1354
+ _v8_function_template_get_function: __v8_function_template_get_function,
1355
+ _v8_function_template_get_function__deps: ["$emnapiCtx"],
1356
+ _v8_function_template_get_function__sig: "ppp",
1357
+ _v8_function_template_instance_template: __v8_function_template_instance_template,
1358
+ _v8_function_template_instance_template__deps: ["$emnapiCtx"],
1359
+ _v8_function_template_instance_template__sig: "pp",
1360
+ _v8_function_template_new: __v8_function_template_new,
1361
+ _v8_function_template_new__deps: ["$emnapiCtx"],
1362
+ _v8_function_template_new__sig: "ppppppiiipiii",
1363
+ _v8_function_template_prototype_template: __v8_function_template_prototype_template,
1364
+ _v8_function_template_prototype_template__deps: ["$emnapiCtx"],
1365
+ _v8_function_template_prototype_template__sig: "pp",
1366
+ _v8_function_template_set_class_name: __v8_function_template_set_class_name,
1367
+ _v8_get_cb_info: __v8_get_cb_info,
1368
+ _v8_get_cb_info__deps: ["$emnapiCtx"],
1369
+ _v8_get_cb_info__sig: "ippppp",
1370
+ _v8_get_property_cb_info: __v8_get_property_cb_info,
1371
+ _v8_get_property_cb_info__deps: ["$emnapiCtx"],
1372
+ _v8_get_property_cb_info__sig: "vpp",
1373
+ _v8_globalize_reference: __v8_globalize_reference,
1374
+ _v8_globalize_reference__deps: ["$emnapiCtx"],
1375
+ _v8_globalize_reference__sig: "ppp",
1376
+ _v8_handle_scope_escape: __v8_handle_scope_escape,
1377
+ _v8_handle_scope_escape__deps: ["$emnapiCtx"],
1378
+ _v8_handle_scope_escape__sig: "ppp",
1379
+ _v8_int32_value: __v8_int32_value,
1380
+ _v8_int32_value__deps: ["$emnapiCtx"],
1381
+ _v8_int32_value__sig: "ip",
1382
+ _v8_integer_new: __v8_integer_new,
1383
+ _v8_integer_new__deps: ["$emnapiCtx"],
1384
+ _v8_integer_new__sig: "ppi",
1385
+ _v8_integer_new_from_unsigned: __v8_integer_new_from_unsigned,
1386
+ _v8_integer_new_from_unsigned__deps: ["$emnapiCtx"],
1387
+ _v8_integer_new_from_unsigned__sig: "ppi",
1388
+ _v8_integer_value: __v8_integer_value,
1389
+ _v8_integer_value__deps: ["$emnapiCtx"],
1390
+ _v8_integer_value__sig: "vpp",
1391
+ _v8_isolate_get_current_context: __v8_isolate_get_current_context,
1392
+ _v8_isolate_get_current_context__sig: "p",
1393
+ _v8_isolate_throw_exception: __v8_isolate_throw_exception,
1394
+ _v8_isolate_throw_exception__deps: ["$emnapiCtx"],
1395
+ _v8_isolate_throw_exception__sig: "pp",
1396
+ _v8_json_parse: __v8_json_parse,
1397
+ _v8_json_parse__deps: ["$emnapiCtx"],
1398
+ _v8_json_parse__sig: "ppp",
1399
+ _v8_json_stringify: __v8_json_stringify,
1400
+ _v8_json_stringify__deps: ["$emnapiCtx"],
1401
+ _v8_json_stringify__sig: "pppp",
1402
+ _v8_local_from_global_reference: __v8_local_from_global_reference,
1403
+ _v8_local_from_global_reference__deps: ["$emnapiCtx"],
1404
+ _v8_local_from_global_reference__sig: "pp",
1405
+ _v8_make_weak: __v8_make_weak,
1406
+ _v8_make_weak__deps: ["$emnapiCtx"],
1407
+ _v8_make_weak__sig: "vppppi",
1408
+ _v8_move_global_reference: __v8_move_global_reference,
1409
+ _v8_move_global_reference__deps: ["$emnapiCtx"],
1410
+ _v8_move_global_reference__sig: "vpp",
1411
+ _v8_number_new: __v8_number_new,
1412
+ _v8_number_new__deps: ["$emnapiCtx"],
1413
+ _v8_number_new__sig: "ppd",
1414
+ _v8_number_object_new: __v8_number_object_new,
1415
+ _v8_number_object_new__deps: ["$emnapiCtx"],
1416
+ _v8_number_object_new__sig: "ppd",
1417
+ _v8_number_value: __v8_number_value,
1418
+ _v8_number_value__deps: ["$emnapiCtx"],
1419
+ _v8_number_value__sig: "dp",
1420
+ _v8_object_delete_private: __v8_object_delete_private,
1421
+ _v8_object_delete_private__deps: ["$emnapiCtx"],
1422
+ _v8_object_delete_private__sig: "ipppp",
1423
+ _v8_object_get_aligned_pointer_in_internal_field: __v8_object_get_aligned_pointer_in_internal_field,
1424
+ _v8_object_get_aligned_pointer_in_internal_field__deps: ["$emnapiCtx"],
1425
+ _v8_object_get_aligned_pointer_in_internal_field__sig: "pip",
1426
+ _v8_object_get_index: __v8_object_get_index,
1427
+ _v8_object_get_index__deps: ["$emnapiCtx"],
1428
+ _v8_object_get_index__sig: "pppi",
1429
+ _v8_object_get_internal_field: __v8_object_get_internal_field,
1430
+ _v8_object_get_internal_field__deps: ["$emnapiCtx"],
1431
+ _v8_object_get_internal_field__sig: "pip",
1432
+ _v8_object_get_key: __v8_object_get_key,
1433
+ _v8_object_get_key__deps: ["$emnapiCtx"],
1434
+ _v8_object_get_key__sig: "pppp",
1435
+ _v8_object_get_private: __v8_object_get_private,
1436
+ _v8_object_get_private__deps: ["$emnapiCtx"],
1437
+ _v8_object_get_private__sig: "pppp",
1438
+ _v8_object_has_private: __v8_object_has_private,
1439
+ _v8_object_has_private__deps: ["$emnapiCtx"],
1440
+ _v8_object_has_private__sig: "ipppp",
1441
+ _v8_object_internal_field_count: __v8_object_internal_field_count,
1442
+ _v8_object_internal_field_count__deps: ["$emnapiCtx"],
1443
+ _v8_object_internal_field_count__sig: "ip",
1444
+ _v8_object_new: __v8_object_new,
1445
+ _v8_object_new__deps: ["$emnapiCtx"],
1446
+ _v8_object_new__sig: "pp",
1447
+ _v8_object_set: __v8_object_set,
1448
+ _v8_object_set__deps: ["$emnapiCtx"],
1449
+ _v8_object_set__sig: "ippppp",
1450
+ _v8_object_set_aligned_pointer_in_internal_field: __v8_object_set_aligned_pointer_in_internal_field,
1451
+ _v8_object_set_aligned_pointer_in_internal_field__deps: ["$emnapiCtx"],
1452
+ _v8_object_set_aligned_pointer_in_internal_field__sig: "vpip",
1453
+ _v8_object_set_internal_field: __v8_object_set_internal_field,
1454
+ _v8_object_set_internal_field__deps: ["$emnapiCtx"],
1455
+ _v8_object_set_internal_field__sig: "vpip",
1456
+ _v8_object_set_private: __v8_object_set_private,
1457
+ _v8_object_set_private__deps: ["$emnapiCtx"],
1458
+ _v8_object_set_private__sig: "ippppp",
1459
+ _v8_object_template_new: __v8_object_template_new,
1460
+ _v8_object_template_new__deps: ["$emnapiCtx"],
1461
+ _v8_object_template_new__sig: "ppp",
1462
+ _v8_object_template_new_instance: __v8_object_template_new_instance,
1463
+ _v8_object_template_new_instance__deps: ["$emnapiCtx"],
1464
+ _v8_object_template_new_instance__sig: "ppp",
1465
+ _v8_object_template_set_accessor: __v8_object_template_set_accessor,
1466
+ _v8_object_template_set_accessor__deps: ["$emnapiCtx"],
1467
+ _v8_object_template_set_accessor__sig: "vpppppppiii",
1468
+ _v8_object_template_set_internal_field_count: __v8_object_template_set_internal_field_count,
1469
+ _v8_object_template_set_internal_field_count__deps: ["$emnapiCtx"],
1470
+ _v8_object_template_set_internal_field_count__sig: "vpi",
1471
+ _v8_open_handle_scope: __v8_open_handle_scope,
1472
+ _v8_open_handle_scope__deps: ["$emnapiCtx"],
1473
+ _v8_open_handle_scope__sig: "pp",
1474
+ _v8_private_for_api: __v8_private_for_api,
1475
+ _v8_private_for_api__deps: ["$emnapiCtx"],
1476
+ _v8_private_for_api__sig: "ppp",
1477
+ _v8_regex_new: __v8_regex_new,
1478
+ _v8_regex_new__deps: ["$emnapiCtx"],
1479
+ _v8_regex_new__sig: "pppi",
1480
+ _v8_script_compiler_compile_unbound_script: __v8_script_compiler_compile_unbound_script,
1481
+ _v8_script_compiler_compile_unbound_script__deps: ["$emnapiCtx"],
1482
+ _v8_script_compiler_compile_unbound_script__sig: "pppii",
1483
+ _v8_script_run: __v8_script_run,
1484
+ _v8_script_run__deps: ["$emnapiCtx"],
1485
+ _v8_script_run__sig: "ppp",
1486
+ _v8_signature_new: __v8_signature_new,
1487
+ _v8_signature_new__deps: ["$emnapiCtx"],
1488
+ _v8_signature_new__sig: "ppp",
1489
+ _v8_string_length: __v8_string_length,
1490
+ _v8_string_length__deps: ["$emnapiCtx"],
1491
+ _v8_string_length__sig: "ip",
1492
+ _v8_string_new_external_one_byte: __v8_string_new_external_one_byte,
1493
+ _v8_string_new_external_one_byte__deps: ["$emnapiCtx", "$emnapiString"],
1494
+ _v8_string_new_external_one_byte__sig: "pppi",
1495
+ _v8_string_new_external_two_byte: __v8_string_new_external_two_byte,
1496
+ _v8_string_new_external_two_byte__deps: ["$emnapiCtx", "$emnapiString"],
1497
+ _v8_string_new_external_two_byte__sig: "pppi",
1498
+ _v8_string_new_from_one_byte: __v8_string_new_from_one_byte,
1499
+ _v8_string_new_from_one_byte__deps: ["$emnapiCtx", "$emnapiString"],
1500
+ _v8_string_new_from_one_byte__sig: "pppii",
1501
+ _v8_string_new_from_two_byte: __v8_string_new_from_two_byte,
1502
+ _v8_string_new_from_two_byte__deps: ["$emnapiCtx", "$emnapiString"],
1503
+ _v8_string_new_from_two_byte__sig: "pppii",
1504
+ _v8_string_new_from_utf8: __v8_string_new_from_utf8,
1505
+ _v8_string_new_from_utf8__deps: ["$emnapiCtx", "$emnapiString"],
1506
+ _v8_string_new_from_utf8__sig: "pppii",
1507
+ _v8_string_object_new: __v8_string_object_new,
1508
+ _v8_string_object_new__deps: ["$emnapiCtx"],
1509
+ _v8_string_object_new__sig: "ppp",
1510
+ _v8_string_object_value_of: __v8_string_object_value_of,
1511
+ _v8_string_object_value_of__deps: ["$emnapiCtx"],
1512
+ _v8_string_object_value_of__sig: "pp",
1513
+ _v8_string_utf8_length: __v8_string_utf8_length,
1514
+ _v8_string_utf8_length__deps: ["$emnapiCtx", "$emnapiString"],
1515
+ _v8_string_utf8_length__sig: "ipp",
1516
+ _v8_string_write_utf8: __v8_string_write_utf8,
1517
+ _v8_string_write_utf8__deps: ["$emnapiCtx", "$emnapiString"],
1518
+ _v8_string_write_utf8__sig: "ipppipi",
1519
+ _v8_template_set: __v8_template_set,
1520
+ _v8_template_set__deps: ["$emnapiCtx"],
1521
+ _v8_template_set__sig: "vpppi",
1522
+ _v8_trycatch_construct: __v8_trycatch_construct,
1523
+ _v8_trycatch_construct__deps: ["$emnapiCtx"],
1524
+ _v8_trycatch_construct__sig: "vp",
1525
+ _v8_trycatch_destruct: __v8_trycatch_destruct,
1526
+ _v8_trycatch_destruct__deps: ["$emnapiCtx"],
1527
+ _v8_trycatch_destruct__sig: "vp",
1528
+ _v8_trycatch_exception: __v8_trycatch_exception,
1529
+ _v8_trycatch_exception__deps: ["$emnapiCtx"],
1530
+ _v8_trycatch_exception__sig: "pp",
1531
+ _v8_trycatch_has_caught: __v8_trycatch_has_caught,
1532
+ _v8_trycatch_has_caught__deps: ["$emnapiCtx"],
1533
+ _v8_trycatch_has_caught__sig: "ip",
1534
+ _v8_trycatch_reset: __v8_trycatch_reset,
1535
+ _v8_trycatch_reset__deps: ["$emnapiCtx"],
1536
+ _v8_trycatch_reset__sig: "vp",
1537
+ _v8_trycatch_rethrow: __v8_trycatch_rethrow,
1538
+ _v8_trycatch_rethrow__deps: ["$emnapiCtx"],
1539
+ _v8_trycatch_rethrow__sig: "pp",
1540
+ _v8_uint32_value: __v8_uint32_value,
1541
+ _v8_uint32_value__deps: ["$emnapiCtx"],
1542
+ _v8_uint32_value__sig: "ip",
1543
+ _v8_unbound_script_bind_to_current_context: __v8_unbound_script_bind_to_current_context,
1544
+ _v8_unbound_script_bind_to_current_context__deps: ["$emnapiCtx"],
1545
+ _v8_unbound_script_bind_to_current_context__sig: "pp",
1546
+ _v8_value_is_false: __v8_value_is_false,
1547
+ _v8_value_is_false__deps: ["$emnapiCtx"],
1548
+ _v8_value_is_false__sig: "ip",
1549
+ _v8_value_is_function: __v8_value_is_function,
1550
+ _v8_value_is_function__deps: ["$emnapiCtx"],
1551
+ _v8_value_is_function__sig: "ip",
1552
+ _v8_value_is_null: __v8_value_is_null,
1553
+ _v8_value_is_null__deps: ["$emnapiCtx"],
1554
+ _v8_value_is_null__sig: "ip",
1555
+ _v8_value_is_number: __v8_value_is_number,
1556
+ _v8_value_is_number__deps: ["$emnapiCtx"],
1557
+ _v8_value_is_number__sig: "ip",
1558
+ _v8_value_is_string: __v8_value_is_string,
1559
+ _v8_value_is_string__deps: ["$emnapiCtx"],
1560
+ _v8_value_is_string__sig: "ip",
1561
+ _v8_value_is_true: __v8_value_is_true,
1562
+ _v8_value_is_true__deps: ["$emnapiCtx"],
1563
+ _v8_value_is_true__sig: "ip",
1564
+ _v8_value_is_undefined: __v8_value_is_undefined,
1565
+ _v8_value_is_undefined__deps: ["$emnapiCtx"],
1566
+ _v8_value_is_undefined__sig: "ip",
1567
+ _v8_value_strict_equals: __v8_value_strict_equals,
1568
+ _v8_value_strict_equals__deps: ["$emnapiCtx"],
1569
+ _v8_value_strict_equals__sig: "ipp",
1570
+ _v8_value_to_array_index: __v8_value_to_array_index,
1571
+ _v8_value_to_array_index__deps: ["$emnapiCtx"],
1572
+ _v8_value_to_array_index__sig: "ppp",
1573
+ _v8_value_to_boolean: __v8_value_to_boolean,
1574
+ _v8_value_to_boolean__deps: ["$emnapiCtx"],
1575
+ _v8_value_to_boolean__sig: "ppp",
1576
+ _v8_value_to_int32: __v8_value_to_int32,
1577
+ _v8_value_to_int32__deps: ["$emnapiCtx"],
1578
+ _v8_value_to_int32__sig: "ppp",
1579
+ _v8_value_to_integer: __v8_value_to_integer,
1580
+ _v8_value_to_integer__deps: ["$emnapiCtx"],
1581
+ _v8_value_to_integer__sig: "ppp",
1582
+ _v8_value_to_number: __v8_value_to_number,
1583
+ _v8_value_to_number__deps: ["$emnapiCtx"],
1584
+ _v8_value_to_number__sig: "ppp",
1585
+ _v8_value_to_object: __v8_value_to_object,
1586
+ _v8_value_to_object__deps: ["$emnapiCtx"],
1587
+ _v8_value_to_object__sig: "ppp",
1588
+ _v8_value_to_string: __v8_value_to_string,
1589
+ _v8_value_to_string__deps: ["$emnapiCtx"],
1590
+ _v8_value_to_string__sig: "ppp",
1591
+ _v8_value_to_uint32: __v8_value_to_uint32,
1592
+ _v8_value_to_uint32__deps: ["$emnapiCtx"],
1593
+ _v8_value_to_uint32__sig: "ppp"
1594
+ });