From 47a800987e9bf5c89bfa2bb0fb3fc1fe74605665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 11 May 2022 15:15:50 -0400 Subject: [PATCH] update test fixtures --- .../babel-helper-simple-access/src/index.ts | 2 +- .../fixtures/misc/module-exports/output.js | 38 +++++++++++-------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/packages/babel-helper-simple-access/src/index.ts b/packages/babel-helper-simple-access/src/index.ts index fd75388c4c97..2b198edfd961 100644 --- a/packages/babel-helper-simple-access/src/index.ts +++ b/packages/babel-helper-simple-access/src/index.ts @@ -134,7 +134,7 @@ const simpleAssignmentVisitor: Visitor = { // (foo &&= bar) => (foo && foo = bar) path.replaceWith( logicalExpression( - // @ts-expect-error Guarded by + // @ts-expect-error Guarded by LOGICAL_OPERATORS.includes operator, path.node.left, assignmentExpression( diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/module-exports/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/module-exports/output.js index 93a06b3ff979..e7a4de0e3af8 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/module-exports/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/module-exports/output.js @@ -8,15 +8,16 @@ console.log(function () { console.log(function () { throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); }().prop); - -exports += function () { +exports += (function () { throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); -}(); - -exports = function () { +}(), function () { throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); -}() + 4; - +}()); +exports = (function () { + throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); +}() + 4, function () { + throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); +}()); ({ exports } = ({}, function () { @@ -25,7 +26,9 @@ exports = function () { [exports] = ([], function () { throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); }()); -exports = {}; +exports = ({}, function () { + throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); +}()); (function () { throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); })().prop = ""; @@ -35,15 +38,16 @@ console.log(function () { console.log(function () { throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); }().exports); - -module += function () { +module += (function () { throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); -}(); - -module = function () { +}(), function () { throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); -}() + 4; - +}()); +module = (function () { + throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); +}() + 4, function () { + throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); +}()); ({ module } = ({}, function () { @@ -52,7 +56,9 @@ module = function () { [module] = ([], function () { throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); }()); -module = {}; +module = ({}, function () { + throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); +}()); (function () { throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); })().prop = "";