bare-module 3.1.13 → 3.1.14
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/binding.c +9 -9
- package/index.js +1 -1
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/bare-module.bare +0 -0
- package/prebuilds/darwin-x64/bare-module.bare +0 -0
- package/prebuilds/linux-arm64/bare-module.bare +0 -0
- package/prebuilds/linux-x64/bare-module.bare +0 -0
- package/prebuilds/win32-x64/bare-module.bare +0 -0
package/binding.c
CHANGED
|
@@ -461,22 +461,22 @@ bare_module_run_module (js_env_t *env, js_callback_info_t *info) {
|
|
|
461
461
|
err = js_instantiate_module(env, module, on_static_import, (void *) context);
|
|
462
462
|
if (err < 0) return NULL;
|
|
463
463
|
|
|
464
|
-
js_value_t *
|
|
465
|
-
err = js_run_module(env, module, &
|
|
464
|
+
js_value_t *promise;
|
|
465
|
+
err = js_run_module(env, module, &promise);
|
|
466
466
|
if (err < 0) return NULL;
|
|
467
467
|
|
|
468
468
|
bool is_promise;
|
|
469
|
-
err = js_is_promise(env,
|
|
469
|
+
err = js_is_promise(env, promise, &is_promise);
|
|
470
470
|
assert(err == 0);
|
|
471
471
|
|
|
472
472
|
if (is_promise) {
|
|
473
473
|
js_promise_state_t state;
|
|
474
|
-
err = js_get_promise_state(env,
|
|
474
|
+
err = js_get_promise_state(env, promise, &state);
|
|
475
475
|
assert(err == 0);
|
|
476
476
|
|
|
477
477
|
if (state == js_promise_rejected) {
|
|
478
|
-
js_value_t *
|
|
479
|
-
err = js_get_promise_result(env,
|
|
478
|
+
js_value_t *reason;
|
|
479
|
+
err = js_get_promise_result(env, promise, &reason);
|
|
480
480
|
if (err < 0) return NULL;
|
|
481
481
|
|
|
482
482
|
js_value_t *exception;
|
|
@@ -487,15 +487,15 @@ bare_module_run_module (js_env_t *env, js_callback_info_t *info) {
|
|
|
487
487
|
err = js_get_reference_value(env, context->ctx, &ctx);
|
|
488
488
|
assert(err == 0);
|
|
489
489
|
|
|
490
|
-
js_value_t *args[
|
|
490
|
+
js_value_t *args[3] = {reason, promise, exception};
|
|
491
491
|
|
|
492
|
-
js_call_function(env, ctx, argv[2],
|
|
492
|
+
js_call_function(env, ctx, argv[2], 3, args, NULL);
|
|
493
493
|
|
|
494
494
|
return NULL;
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
497
|
|
|
498
|
-
return
|
|
498
|
+
return promise;
|
|
499
499
|
}
|
|
500
500
|
|
|
501
501
|
static js_value_t *
|
package/index.js
CHANGED
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|