MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / CallExpression

Function CallExpression

packages/vite/hmr/helpers/ast-normalizer.ts:281–304  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

279 }
280 },
281 CallExpression(path) {
282 if (t.isImport(path.node.callee) || (t.isIdentifier(path.node.callee) && path.node.callee.name === 'import')) {
283 const first = path.node.arguments[0];
284 if (t.isStringLiteral(first)) {
285 if (isVueLike(first.value)) {
286 path.node.arguments[0] = t.stringLiteral('/ns/rt');
287 } else if (isNsCorePackage(first.value)) {
288 path.node.arguments[0] = t.stringLiteral('/ns/core');
289 }
290 }
291 return;
292 }
293 if (t.isIdentifier(path.node.callee) && path.node.callee.name === 'require') {
294 const first = path.node.arguments[0];
295 if (t.isStringLiteral(first)) {
296 const v = first.value;
297 if (isVueLike(v)) {
298 path.node.arguments[0] = t.stringLiteral('/ns/rt');
299 } else if (isNsCorePackage(v)) {
300 path.node.arguments[0] = t.stringLiteral('/ns/core');
301 }
302 }
303 }
304 },
305 VariableDeclarator(path) {
306 const id = path.node.id;
307 if (t.isIdentifier(id)) {

Callers

nothing calls this directly

Calls 2

isVueLikeFunction · 0.85
isNsCorePackageFunction · 0.85

Tested by

no test coverage detected