jseption 0.0.3 → 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/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);