@jsenv/ast 6.10.0 → 6.10.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/ast",
3
- "version": "6.10.0",
3
+ "version": "6.10.1",
4
4
  "type": "module",
5
5
  "description": "Parse and transform HTML, CSS and JS",
6
6
  "repository": {
@@ -36,7 +36,7 @@
36
36
  "acorn-import-attributes": "1.9.5",
37
37
  "acorn-walk": "8.3.5",
38
38
  "parse5": "8.0.1",
39
- "postcss": "8.5.26",
39
+ "postcss": "8.5.27",
40
40
  "postcss-value-parser": "4.2.0"
41
41
  },
42
42
  "devDependencies": {
@@ -144,8 +144,20 @@ export const parseJsUrls = ({
144
144
  });
145
145
  }
146
146
  },
147
- CallExpression: (node) => {
147
+ CallExpression: (node, ancestors) => {
148
148
  if (isJsModule && isImportMetaResolveCall(node)) {
149
+ const parent = ancestors[ancestors.length - 2];
150
+ if (
151
+ parent &&
152
+ (isNewWorkerCall(parent) ||
153
+ isNewSharedWorkerCall(parent) ||
154
+ isServiceWorkerRegisterCall(parent)) &&
155
+ parent.arguments[0] === node
156
+ ) {
157
+ // the worker call analysis emits this url with the worker metadata
158
+ // (expectedType, expectedSubtype)
159
+ return;
160
+ }
149
161
  analyzeImportMetaResolveCall(node, { onUrl });
150
162
  return;
151
163
  }