jseption 0.0.2 → 0.0.4
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.
- package/README.md +114 -3
- package/dist/bytecode.d.ts +6 -0
- package/dist/bytecode.js +1071 -0
- package/dist/bytecode.js.map +1 -0
- package/dist/interpreter.js +15 -4
- package/dist/interpreter.js.map +1 -1
- package/dist/jit.js +12 -4
- package/dist/jit.js.map +1 -1
- package/dist/jit_runtime.d.ts +2 -0
- package/dist/jit_runtime.js +11 -0
- package/dist/jit_runtime.js.map +1 -1
- package/dist/jseption.d.ts +6 -0
- package/dist/jseption.js +5 -0
- package/dist/jseption.js.map +1 -1
- package/dist/module.d.ts +28 -0
- package/dist/module.js +1166 -0
- package/dist/module.js.map +1 -0
- package/dist/opcodes.js +1 -1
- package/dist/opcodes.js.map +1 -1
- package/dist/parser.d.ts +31 -0
- package/dist/parser.js +2862 -62
- package/dist/parser.js.map +1 -1
- package/dist/qjs.js +86 -17
- package/dist/qjs.js.map +1 -1
- package/dist/quickjs.d.ts +8 -0
- package/dist/quickjs.js +21 -2
- package/dist/quickjs.js.map +1 -1
- package/dist/std.d.ts +2 -0
- package/dist/std.js +34 -0
- package/dist/std.js.map +1 -1
- package/dist/values.d.ts +78 -0
- package/dist/values.js +85 -0
- package/dist/values.js.map +1 -1
- package/dist/version.d.ts +1 -0
- package/dist/version.js +5 -0
- package/dist/version.js.map +1 -0
- package/package.json +3 -2
package/dist/jit.js
CHANGED
|
@@ -338,8 +338,6 @@ function analyze(b, insns) {
|
|
|
338
338
|
case 131 /* OP.for_await_of_next */:
|
|
339
339
|
case 133 /* OP.iterator_get_value_done */:
|
|
340
340
|
bail('generator/async');
|
|
341
|
-
case 54 /* OP.import */:
|
|
342
|
-
bail('dynamic import');
|
|
343
341
|
case 122 /* OP.make_loc_ref */:
|
|
344
342
|
case 123 /* OP.make_arg_ref */:
|
|
345
343
|
case 124 /* OP.make_var_ref_ref */:
|
|
@@ -362,8 +360,6 @@ function analyze(b, insns) {
|
|
|
362
360
|
break;
|
|
363
361
|
case 132 /* OP.iterator_check_object */: break;
|
|
364
362
|
case 12 /* OP.special_object */:
|
|
365
|
-
if (insn.a === 6 /* OPSpecialObject.IMPORT_META */)
|
|
366
|
-
bail('import.meta');
|
|
367
363
|
if (insn.a === 0 /* OPSpecialObject.ARGUMENTS */)
|
|
368
364
|
A.uses_arguments = true;
|
|
369
365
|
if (insn.a === 1 /* OPSpecialObject.MAPPED_ARGUMENTS */) {
|
|
@@ -1391,6 +1387,9 @@ class BlockEmitter {
|
|
|
1391
1387
|
case 5 /* OPSpecialObject.VAR_OBJECT */:
|
|
1392
1388
|
this.push(P('$RT.new_object_null()', 3 /* PK.EXPR */));
|
|
1393
1389
|
break;
|
|
1390
|
+
case 6 /* OPSpecialObject.IMPORT_META */:
|
|
1391
|
+
this.push(P('$RT.import_meta($b)', 3 /* PK.EXPR */));
|
|
1392
|
+
break;
|
|
1394
1393
|
default: bail('special object ' + insn.a);
|
|
1395
1394
|
}
|
|
1396
1395
|
return false;
|
|
@@ -2395,6 +2394,15 @@ class BlockEmitter {
|
|
|
2395
2394
|
this.push(P(`(${this.guard_obj(o)} ? (${k} in ${o}) : $RT.in(${k}, ${o}))`, 3 /* PK.EXPR */));
|
|
2396
2395
|
return false;
|
|
2397
2396
|
}
|
|
2397
|
+
case 54 /* OP.import */: {
|
|
2398
|
+
/* dynamic import(specifier, options): a promise; the specifier is converted to a string first */
|
|
2399
|
+
const opts = this.dup_code(this.depth - 1);
|
|
2400
|
+
const spec = this.dup_code(this.depth - 2);
|
|
2401
|
+
this.pop();
|
|
2402
|
+
this.pop();
|
|
2403
|
+
this.push(P(`$RT.dynamic_import($b, ${spec}, ${opts})`, 3 /* PK.EXPR */));
|
|
2404
|
+
return false;
|
|
2405
|
+
}
|
|
2398
2406
|
case 169 /* OP.instanceof */: {
|
|
2399
2407
|
const c = this.dup_code(this.depth - 1);
|
|
2400
2408
|
const v = this.dup_code(this.depth - 2);
|