jseption 0.0.3 → 0.0.5

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.
@@ -989,7 +989,7 @@ function js_interpret(caller_ctx, func_obj, this_obj, new_target, argv, flags, g
989
989
  v = JS_NewObjectProto(ctx, null);
990
990
  break;
991
991
  case 6 /* OPSpecialObject.IMPORT_META */:
992
- v = JS_ThrowTypeError(ctx, 'import.meta is not supported');
992
+ v = hooks.js_import_meta !== null ? hooks.js_import_meta(ctx, b) : JS_ThrowTypeError(ctx, 'import.meta is not supported');
993
993
  break;
994
994
  default:
995
995
  v = JS_ThrowInternalError(ctx, 'invalid special object ' + arg);
@@ -1409,11 +1409,22 @@ function js_interpret(caller_ctx, func_obj, this_obj, new_target, argv, flags, g
1409
1409
  stack[sp - 1] = proto;
1410
1410
  break;
1411
1411
  }
1412
- case 54 /* OP.import */:
1412
+ case 54 /* OP.import */: {
1413
1413
  sf.cur_pc = pc;
1414
- JS_ThrowTypeError(ctx, 'dynamic import is not supported');
1415
- flow = 1 /* Flow.EXCEPTION */;
1414
+ if (hooks.js_dynamic_import === null) {
1415
+ JS_ThrowTypeError(ctx, 'dynamic import is not supported');
1416
+ flow = 1 /* Flow.EXCEPTION */;
1417
+ break;
1418
+ }
1419
+ const v = hooks.js_dynamic_import(ctx, b, stack[sp - 2], stack[sp - 1]);
1420
+ if (JS_IsException(v)) {
1421
+ flow = 1 /* Flow.EXCEPTION */;
1422
+ break;
1423
+ }
1424
+ sp--;
1425
+ stack[sp - 1] = v;
1416
1426
  break;
1427
+ }
1417
1428
  case 55 /* OP.check_var */: {
1418
1429
  const atom = get_u32(buf, pc);
1419
1430
  pc += 4;