@jsenv/plugin-supervisor 1.7.1 → 1.7.3

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.
@@ -1209,6 +1209,12 @@ window.__supervisor__ = (() => {
1209
1209
  lineno,
1210
1210
  colno
1211
1211
  } = errorEvent;
1212
+ if (error && error.__handled__) {
1213
+ if (logs) {
1214
+ console.log("ignore error event because __handled__ is set");
1215
+ }
1216
+ return;
1217
+ }
1212
1218
  const exception = supervisor.createException(error || message, {
1213
1219
  // when error is reported within a worker error is null
1214
1220
  // but there is a message property on errorEvent
@@ -753,6 +753,7 @@ const generateCodeToSuperviseScriptWithSrc = ({
753
753
  /*
754
754
  * This plugin provides a way for jsenv to supervisor js execution:
755
755
  * - Know how many js are executed, when they are done, collect errors, etc...
756
+ *
756
757
  */
757
758
 
758
759
  const jsenvPluginSupervisor = ({
@@ -978,6 +979,12 @@ const jsenvPluginSupervisor = ({
978
979
  contentType: "text/javascript",
979
980
  content: textContent
980
981
  });
982
+ for (const key of Object.keys(htmlUrlInfo.contentInjections)) {
983
+ const value = htmlUrlInfo.contentInjections[key];
984
+ if (htmlUrlInfo.context.isPlaceholderInjection(value)) {
985
+ inlineScriptReference.urlInfo.contentInjections[key] = value;
986
+ }
987
+ }
981
988
  return inlineScriptReference.generatedSpecifier;
982
989
  },
983
990
  sourcemaps: htmlUrlInfo.kitchen.context.sourcemaps
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/plugin-supervisor",
3
- "version": "1.7.1",
3
+ "version": "1.7.3",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,8 +34,8 @@
34
34
  "prepublishOnly": "npm run build"
35
35
  },
36
36
  "dependencies": {
37
- "@jsenv/ast": "6.7.3",
38
- "@jsenv/sourcemap": "1.3.8"
37
+ "@jsenv/ast": "6.7.6",
38
+ "@jsenv/sourcemap": "1.3.9"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@jsenv/urls": "../../tooling/urls",
@@ -1304,6 +1304,12 @@ window.__supervisor__ = (() => {
1304
1304
  console.log('window "error" event received', errorEvent);
1305
1305
  }
1306
1306
  const { error, message, filename, lineno, colno } = errorEvent;
1307
+ if (error && error.__handled__) {
1308
+ if (logs) {
1309
+ console.log("ignore error event because __handled__ is set");
1310
+ }
1311
+ return;
1312
+ }
1307
1313
  const exception = supervisor.createException(error || message, {
1308
1314
  // when error is reported within a worker error is null
1309
1315
  // but there is a message property on errorEvent
@@ -1,6 +1,7 @@
1
1
  /*
2
2
  * This plugin provides a way for jsenv to supervisor js execution:
3
3
  * - Know how many js are executed, when they are done, collect errors, etc...
4
+ *
4
5
  */
5
6
 
6
7
  import { generateContentFrame } from "@jsenv/humanize";
@@ -256,6 +257,12 @@ export const jsenvPluginSupervisor = ({
256
257
  contentType: "text/javascript",
257
258
  content: textContent,
258
259
  });
260
+ for (const key of Object.keys(htmlUrlInfo.contentInjections)) {
261
+ const value = htmlUrlInfo.contentInjections[key];
262
+ if (htmlUrlInfo.context.isPlaceholderInjection(value)) {
263
+ inlineScriptReference.urlInfo.contentInjections[key] = value;
264
+ }
265
+ }
259
266
  return inlineScriptReference.generatedSpecifier;
260
267
  },
261
268
  sourcemaps: htmlUrlInfo.kitchen.context.sourcemaps,