@babel/plugin-transform-optional-chaining 8.0.1 → 8.1.4
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/lib/index.js +10 -5
- package/package.json +5 -5
- package/lib/index.js.map +0 -1
package/lib/index.js
CHANGED
|
@@ -52,7 +52,13 @@ function isSimpleMemberExpression(expression) {
|
|
|
52
52
|
expression = skipTransparentExprWrapperNodes(expression);
|
|
53
53
|
return types.isIdentifier(expression) || types.isSuper(expression) || types.isMemberExpression(expression) && !expression.computed && isSimpleMemberExpression(expression.object);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function isStaticForNullishCheck(scope, node, pureGetters) {
|
|
56
|
+
if (types.isIdentifier(node)) {
|
|
57
|
+
return pureGetters || scope.hasBinding(node.name);
|
|
58
|
+
}
|
|
59
|
+
return scope.isStatic(node);
|
|
60
|
+
}
|
|
61
|
+
function needsMemoize(path, pureGetters) {
|
|
56
62
|
let optionalPath = path;
|
|
57
63
|
const {
|
|
58
64
|
scope
|
|
@@ -63,7 +69,7 @@ function needsMemoize(path) {
|
|
|
63
69
|
} = optionalPath;
|
|
64
70
|
const childPath = skipTransparentExprWrappers(optionalPath.isOptionalMemberExpression() ? optionalPath.get("object") : optionalPath.get("callee"));
|
|
65
71
|
if (node.optional) {
|
|
66
|
-
return !scope
|
|
72
|
+
return !isStaticForNullishCheck(scope, childPath.node, pureGetters);
|
|
67
73
|
}
|
|
68
74
|
optionalPath = childPath;
|
|
69
75
|
}
|
|
@@ -79,7 +85,7 @@ function transformOptionalChain(path, {
|
|
|
79
85
|
const {
|
|
80
86
|
scope
|
|
81
87
|
} = path;
|
|
82
|
-
if (scope.path.isPattern() && needsMemoize(path)) {
|
|
88
|
+
if (scope.path.isPattern() && needsMemoize(path, pureGetters)) {
|
|
83
89
|
replacementPath.replaceWith(template.expression.ast`(() => ${replacementPath.node})()`);
|
|
84
90
|
return;
|
|
85
91
|
}
|
|
@@ -119,7 +125,7 @@ function transformOptionalChain(path, {
|
|
|
119
125
|
node.callee = types.sequenceExpression([types.numericLiteral(0), ref]);
|
|
120
126
|
} else if (pureGetters && isCall && isSimpleMemberExpression(chain)) {
|
|
121
127
|
check = ref = node.callee;
|
|
122
|
-
} else if (scope
|
|
128
|
+
} else if (isStaticForNullishCheck(scope, chain, pureGetters)) {
|
|
123
129
|
check = ref = chainWithTypes;
|
|
124
130
|
} else {
|
|
125
131
|
if (!tmpVar || isCall) {
|
|
@@ -239,4 +245,3 @@ const index = declare((api, options) => {
|
|
|
239
245
|
});
|
|
240
246
|
|
|
241
247
|
export { index as default, transform, transformOptionalChain };
|
|
242
|
-
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babel/plugin-transform-optional-chaining",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.1.4",
|
|
4
4
|
"description": "Transform optional chaining operators into a series of nil checks",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/helper-plugin-utils": "^8.0.1",
|
|
21
|
-
"@babel/helper-skip-transparent-expression-wrappers": "^8.
|
|
21
|
+
"@babel/helper-skip-transparent-expression-wrappers": "^8.1.0"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@babel/core": "^8.0.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@babel/core": "^8.
|
|
27
|
+
"@babel/core": "^8.1.4",
|
|
28
28
|
"@babel/helper-plugin-test-runner": "^8.0.0",
|
|
29
|
-
"@babel/plugin-transform-block-scoping": "^8.
|
|
30
|
-
"@babel/traverse": "^8.
|
|
29
|
+
"@babel/plugin-transform-block-scoping": "^8.1.4",
|
|
30
|
+
"@babel/traverse": "^8.1.4"
|
|
31
31
|
},
|
|
32
32
|
"engines": {
|
|
33
33
|
"node": "^22.18.0 || >=24.11.0"
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/util.ts","../src/transform.ts","../src/index.ts"],"sourcesContent":["import type { NodePath } from \"@babel/core\";\nimport { isTransparentExprWrapper } from \"@babel/helper-skip-transparent-expression-wrappers\";\n/**\n * Test if a NodePath will be cast to boolean when evaluated.\n * It respects transparent expression wrappers defined in\n * \"@babel/helper-skip-transparent-expression-wrappers\"\n *\n * @example\n * // returns true\n * const nodePathADotB = NodePath(\"if (a.b) {}\").get(\"test\"); // a.b\n * willPathCastToBoolean(nodePathADotB)\n * @example\n * // returns false\n * willPathCastToBoolean(NodePath(\"a.b\"))\n * @param {NodePath} path\n * @returns {boolean}\n */\nexport function willPathCastToBoolean(path: NodePath): boolean {\n const maybeWrapped = findOutermostTransparentParent(path);\n const { node, parentPath } = maybeWrapped;\n if (parentPath.isLogicalExpression()) {\n const { operator, right } = parentPath.node;\n if (\n operator === \"&&\" ||\n operator === \"||\" ||\n (operator === \"??\" && node === right)\n ) {\n return willPathCastToBoolean(parentPath);\n }\n }\n if (parentPath.isSequenceExpression()) {\n const { expressions } = parentPath.node;\n if (expressions[expressions.length - 1] === node) {\n return willPathCastToBoolean(parentPath);\n } else {\n // if it is in the middle of a sequence expression, we don't\n // care the return value so just cast to boolean for smaller\n // output\n return true;\n }\n }\n return (\n parentPath.isConditional({ test: node }) ||\n parentPath.isUnaryExpression({ operator: \"!\" }) ||\n // @ts-expect-error FIXME: test should allow t.Node\n parentPath.isForStatement({ test: node }) ||\n parentPath.isWhile({ test: node })\n );\n}\n\n/**\n * Return the outermost transparent expression wrapper of a given path,\n * otherwise returns path itself.\n * @example\n * const nodePathADotB = NodePath(\"(a.b as any)\").get(\"expression\"); // a.b\n * // returns NodePath(\"(a.b as any)\")\n * findOutermostTransparentParent(nodePathADotB);\n * @param {NodePath} path\n * @returns {NodePath}\n */\nexport function findOutermostTransparentParent(path: NodePath): NodePath {\n let maybeWrapped = path;\n path.findParent(p => {\n if (!isTransparentExprWrapper(p.node)) return true;\n maybeWrapped = p;\n return false;\n });\n return maybeWrapped;\n}\n","import { types as t, template, type NodePath } from \"@babel/core\";\nimport {\n skipTransparentExprWrapperNodes,\n skipTransparentExprWrappers,\n} from \"@babel/helper-skip-transparent-expression-wrappers\";\nimport {\n willPathCastToBoolean,\n findOutermostTransparentParent,\n} from \"./util.ts\";\n\n// TODO(Babel 9): Use .at(-1)\nconst last = <T>(arr: T[]) => arr[arr.length - 1];\n\nfunction isSimpleMemberExpression(\n expression: t.Expression | t.Super,\n): expression is t.Identifier | t.Super | t.MemberExpression {\n expression = skipTransparentExprWrapperNodes(expression);\n return (\n t.isIdentifier(expression) ||\n t.isSuper(expression) ||\n (t.isMemberExpression(expression) &&\n !expression.computed &&\n isSimpleMemberExpression(expression.object))\n );\n}\n\n/**\n * Test if a given optional chain `path` needs to be memoized\n * @param {NodePath} path\n * @returns {boolean}\n */\nfunction needsMemoize(\n path: NodePath<t.OptionalCallExpression | t.OptionalMemberExpression>,\n) {\n let optionalPath: NodePath = path;\n const { scope } = path;\n while (\n optionalPath.isOptionalMemberExpression() ||\n optionalPath.isOptionalCallExpression()\n ) {\n const { node } = optionalPath;\n const childPath = skipTransparentExprWrappers(\n optionalPath.isOptionalMemberExpression()\n ? optionalPath.get(\"object\")\n : optionalPath.get(\"callee\"),\n );\n if (node.optional) {\n return !scope.isStatic(childPath.node);\n }\n\n optionalPath = childPath;\n }\n}\n\nconst NULLISH_CHECK = template.expression(\n `%%check%% === null || %%ref%% === void 0`,\n);\nconst NULLISH_CHECK_NO_DDA = template.expression(`%%check%% == null`);\nconst NULLISH_CHECK_NEG = template.expression(\n `%%check%% !== null && %%ref%% !== void 0`,\n);\nconst NULLISH_CHECK_NO_DDA_NEG = template.expression(`%%check%% != null`);\n\ninterface OptionalChainAssumptions {\n pureGetters: boolean;\n noDocumentAll: boolean;\n}\n\nexport function transformOptionalChain(\n path: NodePath<t.OptionalCallExpression | t.OptionalMemberExpression>,\n { pureGetters, noDocumentAll }: OptionalChainAssumptions,\n replacementPath: NodePath<t.Expression>,\n ifNullish: t.Expression,\n wrapLast?: (value: t.Expression) => t.Expression,\n) {\n const { scope } = path;\n\n // Replace `function (a, x = a.b?.c) {}` to `function (a, x = (() => a.b?.c)() ){}`\n // so the temporary variable can be injected in correct scope\n if (scope.path.isPattern() && needsMemoize(path)) {\n replacementPath.replaceWith(\n template.expression.ast`(() => ${replacementPath.node})()`,\n );\n // The injected optional chain will be queued and eventually transformed when visited\n return;\n }\n\n const optionals = [];\n\n let optionalPath = path;\n while (\n optionalPath.isOptionalMemberExpression() ||\n optionalPath.isOptionalCallExpression()\n ) {\n const { node } = optionalPath;\n if (node.optional) {\n optionals.push(node);\n }\n if (optionalPath.isOptionalMemberExpression()) {\n // @ts-expect-error todo(flow->ts) avoid changing more type\n optionalPath.node.type = \"MemberExpression\";\n // @ts-expect-error todo(flow->ts)\n optionalPath = skipTransparentExprWrappers(optionalPath.get(\"object\"));\n } else if (optionalPath.isOptionalCallExpression()) {\n // @ts-expect-error todo(flow->ts) avoid changing more type\n optionalPath.node.type = \"CallExpression\";\n // @ts-expect-error todo(flow->ts)\n optionalPath = skipTransparentExprWrappers(optionalPath.get(\"callee\"));\n }\n }\n\n if (optionals.length === 0) {\n // Malformed AST: there was an OptionalMemberExpression node\n // with no actual optional elements.\n return;\n }\n\n const checks = [];\n\n let tmpVar;\n\n for (let i = optionals.length - 1; i >= 0; i--) {\n const node = optionals[i] as unknown as\n | t.MemberExpression\n | t.CallExpression;\n\n const isCall = t.isCallExpression(node);\n\n const chainWithTypes = isCall\n ? // V8 intrinsics must not be an optional call\n (node.callee as t.Expression)\n : node.object;\n const chain = skipTransparentExprWrapperNodes(chainWithTypes);\n\n let ref;\n let check;\n if (isCall && t.isIdentifier(chain, { name: \"eval\" })) {\n check = ref = chain;\n // `eval?.()` is an indirect eval call transformed to `(0,eval)()`\n node.callee = t.sequenceExpression([t.numericLiteral(0), ref]);\n } else if (pureGetters && isCall && isSimpleMemberExpression(chain)) {\n // If we assume getters are pure (avoiding a Function#call) and we are at the call,\n // we can avoid a needless memoize. We only do this if the callee is a simple member\n // expression, to avoid multiple calls to nested call expressions.\n check = ref = node.callee;\n } else if (scope.isStatic(chain)) {\n check = ref = chainWithTypes;\n } else {\n // We cannot reuse the tmpVar for calls, because we need to\n // store both the method and the receiver.\n if (!tmpVar || isCall) {\n tmpVar = scope.generateUidIdentifierBasedOnNode(chain);\n scope.push({ id: t.cloneNode(tmpVar) });\n }\n ref = tmpVar;\n check = t.assignmentExpression(\n \"=\",\n t.cloneNode(tmpVar),\n // Here `chainWithTypes` MUST NOT be cloned because it could be\n // updated when generating the memoised context of a call\n // expression. It must be an Expression when `ref` is an identifier\n chainWithTypes as t.Expression,\n );\n\n if (isCall) {\n node.callee = ref;\n } else {\n node.object = ref;\n }\n }\n\n // Ensure call expressions have the proper `this`\n // `foo.bar()` has context `foo`.\n if (isCall && t.isMemberExpression(chain)) {\n if (pureGetters && isSimpleMemberExpression(chain)) {\n // To avoid a Function#call, we can instead re-grab the property from the context object.\n // `a.?b.?()` translates roughly to `_a.b != null && _a.b()`\n node.callee = chainWithTypes;\n } else {\n // Otherwise, we need to memoize the context object, and change the call into a Function#call.\n // `a.?b.?()` translates roughly to `(_b = _a.b) != null && _b.call(_a)`\n const { object } = chain;\n let context: t.Expression;\n if (t.isSuper(object)) {\n context = t.thisExpression();\n } else {\n const memoized = scope.maybeGenerateMemoised(object);\n if (memoized) {\n context = memoized;\n chain.object = t.assignmentExpression(\"=\", memoized, object);\n } else {\n context = object;\n }\n }\n\n node.arguments.unshift(t.cloneNode(context));\n // @ts-expect-error node.callee can not be an V8IntrinsicIdentifier: V8 intrinsic is disallowed in optional chain\n node.callee = t.memberExpression(node.callee, t.identifier(\"call\"));\n }\n }\n\n const data = { check: t.cloneNode(check), ref: t.cloneNode(ref) };\n // We make `ref` non-enumerable, so that @babel/template doesn't throw\n // in the noDocumentAll template if it's not used.\n Object.defineProperty(data, \"ref\", { enumerable: false });\n checks.push(data);\n }\n\n let result = replacementPath.node;\n if (wrapLast) result = wrapLast(result);\n\n const ifNullishBoolean = t.isBooleanLiteral(ifNullish);\n const ifNullishFalse = ifNullishBoolean && ifNullish.value === false;\n const ifNullishVoid =\n !ifNullishBoolean && t.isUnaryExpression(ifNullish, { operator: \"void\" });\n\n const isEvaluationValueIgnored =\n (t.isExpressionStatement(replacementPath.parent) &&\n !replacementPath.isCompletionRecord()) ||\n (t.isSequenceExpression(replacementPath.parent) &&\n last(replacementPath.parent.expressions) !== replacementPath.node);\n\n // prettier-ignore\n const tpl = ifNullishFalse\n ?( noDocumentAll ? NULLISH_CHECK_NO_DDA_NEG : NULLISH_CHECK_NEG)\n :( noDocumentAll ? NULLISH_CHECK_NO_DDA : NULLISH_CHECK);\n const logicalOp = ifNullishFalse ? \"&&\" : \"||\";\n\n const check = checks\n .map(tpl)\n .reduce((expr, check) => t.logicalExpression(logicalOp, expr, check));\n\n replacementPath.replaceWith(\n ifNullishBoolean || (ifNullishVoid && isEvaluationValueIgnored)\n ? t.logicalExpression(logicalOp, check, result)\n : t.conditionalExpression(check, ifNullish, result),\n );\n}\n\nexport function transform(\n path: NodePath<t.OptionalCallExpression | t.OptionalMemberExpression>,\n assumptions: OptionalChainAssumptions,\n) {\n const { scope } = path;\n\n // maybeWrapped points to the outermost transparent expression wrapper\n // or the path itself\n const maybeWrapped = findOutermostTransparentParent(path);\n const { parentPath } = maybeWrapped;\n\n if (parentPath.isUnaryExpression({ operator: \"delete\" })) {\n transformOptionalChain(\n path,\n assumptions,\n parentPath,\n t.booleanLiteral(true),\n );\n } else {\n let wrapLast: ((value: t.Expression) => t.Expression) | undefined;\n if (\n parentPath.isCallExpression({ callee: maybeWrapped.node }) &&\n // note that the first condition must implies that `path.optional` is `true`,\n // otherwise the parentPath should be an OptionalCallExpression\n path.isOptionalMemberExpression()\n ) {\n // Ensure (a?.b)() has proper `this`\n wrapLast = ((replacement: t.MemberExpression) => {\n // `(a?.b)()` to `(a == null ? undefined : a.b.bind(a))()`\n // object must not be Super as super?.foo is invalid\n\n const object = skipTransparentExprWrapperNodes(\n replacement.object,\n ) as t.Expression;\n let baseRef: t.Expression | undefined;\n if (!assumptions.pureGetters || !isSimpleMemberExpression(object)) {\n // memoize the context object when getters are not always pure\n // or the object is not a simple member expression\n // `(a?.b.c)()` to `(a == null ? undefined : (_a$b = a.b).c.bind(_a$b))()`\n baseRef = scope.maybeGenerateMemoised(object)!;\n if (baseRef) {\n replacement.object = t.assignmentExpression(\"=\", baseRef, object);\n }\n }\n return t.callExpression(\n t.memberExpression(replacement, t.identifier(\"bind\")),\n [t.cloneNode(baseRef ?? object)],\n );\n }) as (value: t.Expression) => t.Expression;\n }\n\n transformOptionalChain(\n path,\n assumptions,\n path,\n willPathCastToBoolean(maybeWrapped)\n ? t.booleanLiteral(false)\n : t.buildUndefinedNode(),\n wrapLast,\n );\n }\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { transform, transformOptionalChain } from \"./transform.ts\";\nimport type { NodePath, types as t } from \"@babel/core\";\n\nexport interface Options {\n /** @deprecated Use the `noDocumentAll` and `pureGetters` assumptions instead. */\n loose?: boolean;\n}\nexport default declare((api, options: Options) => {\n api.assertVersion(REQUIRED_VERSION(\"^7.0.0-0 || ^8.0.0\"));\n\n if (\"loose\" in options) {\n console.warn(\n \"@babel/plugin-transform-optional-chaining: The 'loose' option has been deprecated, \" +\n \"use the `noDocumentAll` and `pureGetters` assumptions instead (https://babeljs.io/assumptions).\",\n );\n }\n\n const { loose = false } = options;\n const noDocumentAll = api.assumption(\"noDocumentAll\") ?? loose;\n const pureGetters = api.assumption(\"pureGetters\") ?? loose;\n\n return {\n name: \"transform-optional-chaining\",\n manipulateOptions: undefined,\n visitor: api.traverse.explode({\n \"OptionalCallExpression|OptionalMemberExpression\"(\n path: NodePath<t.OptionalCallExpression | t.OptionalMemberExpression>,\n ) {\n transform(path, { noDocumentAll, pureGetters });\n },\n }),\n };\n});\n\nexport { transform, transformOptionalChain };\n"],"names":["t","OptionalCallExpression|OptionalMemberExpression"],"mappings":";;;;AAiBO,SAAS,qBAAqB,CAAC,IAAc,EAAW;AAC7D,EAAA,MAAM,YAAY,GAAG,8BAA8B,CAAC,IAAI,CAAC;EACzD,MAAM;IAAE,IAAI;AAAE,IAAA;AAAW,GAAC,GAAG,YAAY;AACzC,EAAA,IAAI,UAAU,CAAC,mBAAmB,EAAE,EAAE;IACpC,MAAM;MAAE,QAAQ;AAAE,MAAA;KAAO,GAAG,UAAU,CAAC,IAAI;AAC3C,IAAA,IACE,QAAQ,KAAK,IAAI,IACjB,QAAQ,KAAK,IAAI,IAChB,QAAQ,KAAK,IAAI,IAAI,IAAI,KAAK,KAAM,EACrC;MACA,OAAO,qBAAqB,CAAC,UAAU,CAAC;AAC1C,IAAA;AACF,EAAA;AACA,EAAA,IAAI,UAAU,CAAC,oBAAoB,EAAE,EAAE;IACrC,MAAM;AAAE,MAAA;KAAa,GAAG,UAAU,CAAC,IAAI;IACvC,IAAI,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE;MAChD,OAAO,qBAAqB,CAAC,UAAU,CAAC;AAC1C,IAAA,CAAC,MAAM;AAIL,MAAA,OAAO,IAAI;AACb,IAAA;AACF,EAAA;EACA,OACE,UAAU,CAAC,aAAa,CAAC;AAAE,IAAA,IAAI,EAAE;AAAK,GAAC,CAAC,IACxC,UAAU,CAAC,iBAAiB,CAAC;AAAE,IAAA,QAAQ,EAAE;AAAI,GAAC,CAAC,IAE/C,UAAU,CAAC,cAAc,CAAC;AAAE,IAAA,IAAI,EAAE;AAAK,GAAC,CAAC,IACzC,UAAU,CAAC,OAAO,CAAC;AAAE,IAAA,IAAI,EAAE;AAAK,GAAC,CAAC;AAEtC;AAYO,SAAS,8BAA8B,CAAC,IAAc,EAAY;EACvE,IAA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