@jsenv/core 23.0.6 → 23.1.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.
@@ -3181,7 +3181,13 @@
3181
3181
  }
3182
3182
  }, function (_result2) {
3183
3183
  return _exit2 ? _result2 : _catch$4(function () {
3184
- return _await$8(instantiate.call(_this, url, importerUrl));
3184
+ return _await$8(instantiate.call(_this, url, importerUrl), function (registration) {
3185
+ if (!registration) {
3186
+ throw new Error("no registration found for JS at ".concat(url, "\n--- importer url ---\n").concat(importerUrl, "\n--- navigator.vendor ---\n").concat(window.navigator.vendor));
3187
+ }
3188
+
3189
+ return registration;
3190
+ });
3185
3191
  }, function (e) {
3186
3192
  return _await$8(createDetailedInstantiateError({
3187
3193
  instantiateError: e,
@@ -3242,7 +3248,13 @@
3242
3248
  }
3243
3249
  };
3244
3250
  });
3245
- return browserSystem.getRegister(url);
3251
+ var registration = browserSystem.getRegister(url);
3252
+
3253
+ if (!registration) {
3254
+ throw new Error("no registration found for JSON at ".concat(url, ". Navigator.vendor: ").concat(window.navigator.vendor, ". JSON text: ").concat(json));
3255
+ }
3256
+
3257
+ return registration;
3246
3258
  });
3247
3259
  });
3248
3260
  });
@@ -4823,7 +4835,11 @@
4823
4835
  // browser having Error.captureStackTrace got window.fetch
4824
4836
  // and this executes only when Error.captureStackTrace exists
4825
4837
  // so no need for polyfill or whatever here
4826
- return _await$2(window.fetch(url), function (response) {
4838
+ return _await$2(window.fetch(url, {
4839
+ // by default a script tag is in "no-cors"
4840
+ // so we also fetch url with "no-cors"
4841
+ mode: "no-cors"
4842
+ }), function (response) {
4827
4843
  // we read response test before anything because once memoized fetch
4828
4844
  // gets annoying preventing you to read
4829
4845
  // body multiple times, even using response.clone()