summaryrefslogtreecommitdiff
path: root/node_modules/@babel/plugin-transform-optional-chaining/lib/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@babel/plugin-transform-optional-chaining/lib/index.js')
-rw-r--r--node_modules/@babel/plugin-transform-optional-chaining/lib/index.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/node_modules/@babel/plugin-transform-optional-chaining/lib/index.js b/node_modules/@babel/plugin-transform-optional-chaining/lib/index.js
index 170e91d7..73207ac5 100644
--- a/node_modules/@babel/plugin-transform-optional-chaining/lib/index.js
+++ b/node_modules/@babel/plugin-transform-optional-chaining/lib/index.js
@@ -131,7 +131,11 @@ function transformOptionalChain(path, {
}
ref = tmpVar;
check = core.types.assignmentExpression("=", core.types.cloneNode(tmpVar), chainWithTypes);
- isCall ? node.callee = ref : node.object = ref;
+ if (isCall) {
+ node.callee = ref;
+ } else {
+ node.object = ref;
+ }
}
if (isCall && core.types.isMemberExpression(chain)) {
if (pureGetters && isSimpleMemberExpression(chain)) {