From c7a06b1a5e3a59abccbd40fed1f65fcf8487fba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Tue, 23 Apr 2024 10:48:33 +0900 Subject: [PATCH] fix(es/codegen): Use `Str.raw` for es5 (#8873) **Related issue:** - Closes #8871 --- .../member-expr/precendence/output/index.js | 2 +- .../issues-1xxx/1227/case-1/output/index.js | 2 +- .../issues-1xxx/1358/case2/output/index.js | 2 +- .../issues-1xxx/1744/case1/output/index.js | 2 +- .../issues-5xxx/5068/1/output/index.js | 4 +- .../issues-5xxx/5068/2/output/index.js | 4 +- .../5214/1/output/src/foo.bar.baz.js | 2 +- .../fixture/issues-5xxx/5556/output/index.js | 10 +- .../issues-6xxx/6418/1/output/input.js | 2 +- .../issues-6xxx/6460/1/output/index.js | 2 +- .../issues-6xxx/6508/1/output/index.js | 2 +- .../issues-6xxx/6508/2/output/index.js | 2 +- .../issues-6xxx/6508/3/output/index.js | 2 +- .../fixture/issues-6xxx/6888/output/index.js | 4 +- .../fixture/issues-6xxx/6898/output/exec.js | 8 +- .../issues-6xxx/6984/1/output/index.js | 4 +- .../fixture/issues-7xxx/7240/output/index.js | 6 +- .../fixture/issues-7xxx/7253/output/input.js | 2 +- .../fixture/issues-7xxx/7546/output/1.js | 2 +- .../issues-7xxx/7736/case1/output/index.js | 6 +- .../fixture/issues-7xxx/7805/output/1.js | 18 +- .../fixture/issues-7xxx/7821/output/1.js | 2 +- .../fixture/issues-8xxx/8185/output/helper.js | 4 +- .../fixture/issues-8xxx/8185/output/input.js | 2 +- .../fixture/issues-8xxx/8193/output/1.js | 12 +- .../fixture/issues-8xxx/8345/output/1.js | 2 +- .../fixture/issues-8xxx/8435/output/index.js | 4 +- .../fixture/issues-8xxx/8482/output/index.js | 2 +- .../fixture/issues-8xxx/8616/output/1.js | 8 +- .../8701/1/output/src/app.controller.spec.ts | 6 +- .../8701/1/output/src/app.service.ts | 2 +- .../fixture/issues-8xxx/8863/input/.swcrc | 19 + .../tests/fixture/issues-8xxx/8863/input/1.js | 1 + .../fixture/issues-8xxx/8863/output/1.js | 1 + .../fixture/issues-8xxx/8871/input/.swcrc | 25 + .../tests/fixture/issues-8xxx/8871/input/1.js | 5 + .../fixture/issues-8xxx/8871/output/1.js | 4 + .../output/src/users/users.controller.spec.ts | 4 +- .../1/output/src/users/users.controller.ts | 14 +- .../1/output/src/users/users.service.spec.ts | 4 +- .../7603/1/output/src/users/users.service.ts | 2 +- .../output/src/users/users.controller.spec.ts | 4 +- .../2/output/src/users/users.controller.ts | 14 +- .../2/output/src/users/users.service.spec.ts | 4 +- .../7603/2/output/src/users/users.service.ts | 2 +- .../vercel-site/1/output/identity.ts | 4 +- .../nanoid/async/index.browser.js | 10 +- .../node_modules/nanoid/async/index.js | 6 +- .../node_modules/nanoid/async/index.native.js | 6 +- .../node_modules/nanoid/bin/nanoid.js | 14 +- .../node_modules/nanoid/index.browser.js | 10 +- .../nanoid@4.0.2/node_modules/nanoid/index.js | 6 +- .../node_modules/nanoid/non-secure/index.js | 6 +- .../node_modules/nanoid/url-alphabet/index.js | 2 +- .../tests/fixture/next.js/octal/1/output/1.js | 2 +- crates/swc/tests/projects/issue-226/input.js | 2 +- ...nctionUsingClassPrivateStatics.1.normal.js | 2 +- ...tionUsingClassPrivateStatics.2.minified.js | 2 +- .../tsc-references/ES5For-of1.1.normal.js | 6 +- .../tsc-references/ES5For-of1.2.minified.js | 6 +- .../tsc-references/ES5For-of13.1.normal.js | 6 +- .../tsc-references/ES5For-of13.2.minified.js | 6 +- .../tsc-references/ES5For-of3.1.normal.js | 6 +- .../tsc-references/ES5For-of3.2.minified.js | 6 +- .../tsc-references/ES5For-of33.1.normal.js | 6 +- .../tsc-references/ES5For-of33.2.minified.js | 6 +- .../tsc-references/ES5For-of34.1.normal.js | 6 +- .../tsc-references/ES5For-of34.2.minified.js | 6 +- .../tsc-references/ES5For-of37.1.normal.js | 4 +- .../tsc-references/ES5For-of37.2.minified.js | 4 +- .../tsc-references/ES5For-of8.1.normal.js | 6 +- .../tsc-references/ES5For-of8.2.minified.js | 6 +- .../ES5For-ofTypeCheck13.1.normal.js | 4 +- .../ES5For-ofTypeCheck13.2.minified.js | 2 +- ...xportedAndNonExportedVariables.1.normal.js | 2 +- ...ortedAndNonExportedVariables.2.minified.js | 2 +- ...cessorsAreNotContextuallyTyped.1.normal.js | 2 +- ...ssorsAreNotContextuallyTyped.2.minified.js | 2 +- ...ionOperatorWithAnyAndEveryType.1.normal.js | 4 +- ...ithNullValueAndInvalidOperator.1.normal.js | 2 +- ...rWithNullValueAndValidOperator.1.normal.js | 4 +- ...OperatorWithStringAndEveryType.1.normal.js | 4 +- ...definedValueAndInvalidOperands.1.normal.js | 2 +- ...UndefinedValueAndValidOperator.1.normal.js | 4 +- ...dLineSeparatorsInStringLiteral.1.normal.js | 18 +- .../anyAsConstructor.1.normal.js | 2 +- .../anyAsConstructor.2.minified.js | 2 +- .../anyAsFunctionCall.1.normal.js | 2 +- .../anyAsFunctionCall.2.minified.js | 2 +- .../anyAsGenericFunctionCall.1.normal.js | 2 +- .../anyAsGenericFunctionCall.2.minified.js | 2 +- .../anyPropertyAccess.1.normal.js | 6 +- .../anyPropertyAccess.2.minified.js | 2 +- .../tsc-references/arrayLiterals.1.normal.js | 16 +- .../arrayOfFunctionTypes3.1.normal.js | 4 +- .../arrayOfFunctionTypes3.2.minified.js | 4 +- .../arraySpreadInCall.1.normal.js | 26 +- .../arraySpreadInCall.2.minified.js | 26 +- .../arrowFunctionExpressions.1.normal.js | 8 +- .../tsc-references/asOperator1.1.normal.js | 2 +- .../assignFromStringInterface.1.normal.js | 2 +- .../assignFromStringInterface2.1.normal.js | 2 +- ...gnmentCompatWithCallSignatures.1.normal.js | 8 +- ...nmentCompatWithCallSignatures2.1.normal.js | 12 +- ...tCompatWithConstructSignatures.1.normal.js | 4 +- ...CompatWithConstructSignatures2.1.normal.js | 8 +- ...ntCompatWithDiscriminatedUnion.1.normal.js | 2 +- ...ignmentCompatWithObjectMembers.1.normal.js | 4 +- ...gnmentCompatWithObjectMembers2.1.normal.js | 4 +- ...gnmentCompatWithObjectMembers3.1.normal.js | 4 +- ...tWithObjectMembersNumericNames.1.normal.js | 4 +- ...bjectMembersStringNumericNames.1.normal.js | 8 +- .../assignmentLHSIsReference.1.normal.js | 4 +- ...mentToParenthesizedIdentifiers.1.normal.js | 36 +- ...ntToParenthesizedIdentifiers.2.minified.js | 8 +- ...nTypeOfConditionalExpressions2.1.normal.js | 2 +- .../booleanPropertyAccess.1.normal.js | 2 +- ...IncorrectNumberOfTypeArguments.1.normal.js | 28 +- ...correctNumberOfTypeArguments.2.minified.js | 6 +- .../tsc-references/callOverload.1.normal.js | 2 +- .../tsc-references/callOverload.2.minified.js | 2 +- ...resThatDifferOnlyByReturnType2.1.normal.js | 2 +- ...sThatDifferOnlyByReturnType2.2.minified.js | 2 +- .../callWithSpread3.1.normal.js | 24 +- .../callWithSpread3.2.minified.js | 24 +- .../callbackTagNamespace.1.normal.js | 2 +- .../callbackTagVariadicType.1.normal.js | 2 +- .../callbackTagVariadicType.2.minified.js | 2 +- .../tests/tsc-references/chained.1.normal.js | 4 +- .../tsc-references/chained.2.minified.js | 4 +- .../tests/tsc-references/chained2.1.normal.js | 6 +- .../tsc-references/chained2.2.minified.js | 6 +- .../chainedPrototypeAssignment.1.normal.js | 6 +- .../chainedPrototypeAssignment.2.minified.js | 4 +- .../checkJsdocSatisfiesTag1.1.normal.js | 6 +- .../checkJsdocSatisfiesTag12.1.normal.js | 6 +- .../checkJsdocTypeTag5.1.normal.js | 4 +- ...kJsdocTypeTagOnObjectProperty1.1.normal.js | 4 +- ...sdocTypeTagOnObjectProperty1.2.minified.js | 2 +- .../checkJsdocTypedefInParamTag1.1.normal.js | 4 +- ...heckJsdocTypedefOnlySourceFile.1.normal.js | 2 +- ...checkJsxChildrenCanBeTupleType.1.normal.js | 2 +- ...eckJsxChildrenCanBeTupleType.2.minified.js | 2 +- ...ontextualTypeInferredCorrectly.1.normal.js | 6 +- ...textualTypeInferredCorrectly.2.minified.js | 6 +- ...ssAppearsToHaveMembersOfObject.1.normal.js | 2 +- ...AppearsToHaveMembersOfObject.2.minified.js | 2 +- ...ssCanExtendConstructorFunction.1.normal.js | 2 +- ...CanExtendConstructorFunction.2.minified.js | 2 +- .../classExtendingClass.1.normal.js | 2 +- .../classExtendingClass.2.minified.js | 2 +- .../classWithConstructors.1.normal.js | 12 +- .../classWithConstructors.2.minified.js | 12 +- .../classWithEmptyBody.1.normal.js | 4 +- .../classWithPrivateProperty.1.normal.js | 12 +- .../classWithPrivateProperty.2.minified.js | 10 +- .../classWithProtectedProperty.1.normal.js | 12 +- .../classWithProtectedProperty.2.minified.js | 10 +- .../classWithPublicProperty.1.normal.js | 12 +- .../classWithPublicProperty.2.minified.js | 10 +- ...lassWithoutExplicitConstructor.1.normal.js | 2 +- ...ssWithoutExplicitConstructor.2.minified.js | 2 +- .../commonJSAliasedExport.1.normal.js | 2 +- .../commonJSAliasedExport.2.minified.js | 2 +- .../commonJSReexport.1.normal.js | 4 +- .../commonJSReexport.2.minified.js | 4 +- ...tionAssignmentLHSCanBeAssigned.1.normal.js | 6 +- ...nAssignmentLHSCannotBeAssigned.1.normal.js | 10 +- ...mpoundAssignmentLHSIsReference.1.normal.js | 8 +- ...iationAssignmentLHSIsReference.1.normal.js | 8 +- .../computedPropertyNames32_ES5.1.normal.js | 2 +- .../computedPropertyNames33_ES5.1.normal.js | 2 +- .../computedPropertyNames34_ES5.1.normal.js | 2 +- ...lOperatorConditoinIsStringType.1.normal.js | 8 +- ...tionalOperatorWithIdenticalBCT.1.normal.js | 10 +- .../conditionalTypes1.1.normal.js | 4 +- .../conditionalTypes1.2.minified.js | 4 +- ...nditionalTypesExcessProperties.1.normal.js | 4 +- ...nflictingCommonJSES2015Exports.1.normal.js | 2 +- ...lictingCommonJSES2015Exports.2.minified.js | 2 +- .../tsc-references/constEnum3.1.normal.js | 4 +- ...gnaturesWithIdenticalOverloads.1.normal.js | 12 +- ...aturesWithIdenticalOverloads.2.minified.js | 4 +- ...nstructSignaturesWithOverloads.1.normal.js | 12 +- ...tructSignaturesWithOverloads.2.minified.js | 4 +- ...structSignaturesWithOverloads2.1.normal.js | 6 +- ...ructSignaturesWithOverloads2.2.minified.js | 4 +- ...orFunctionMethodTypeParameters.1.normal.js | 6 +- ...FunctionMethodTypeParameters.2.minified.js | 4 +- .../constructorFunctions3.1.normal.js | 6 +- .../constructorFunctions3.2.minified.js | 6 +- ...ntextualTypedSpecialAssignment.1.normal.js | 10 +- ...extualTypedSpecialAssignment.2.minified.js | 10 +- .../contextuallyTypedIife.1.normal.js | 2 +- .../contextuallyTypedIife.2.minified.js | 2 +- .../contextuallyTypedIifeStrict.1.normal.js | 2 +- .../contextuallyTypedIifeStrict.2.minified.js | 2 +- .../controlFlowAliasing.1.normal.js | 52 +- ...trolFlowAliasingCatchVariables.1.normal.js | 8 +- .../controlFlowBindingElement.1.normal.js | 24 +- .../controlFlowBindingElement.2.minified.js | 4 +- .../controlFlowElementAccess.1.normal.js | 4 +- .../controlFlowElementAccess2.1.normal.js | 12 +- .../controlFlowElementAccess2.2.minified.js | 2 +- .../controlFlowForInStatement2.1.normal.js | 8 +- .../controlFlowForInStatement2.2.minified.js | 2 +- .../controlFlowGenericTypes.1.normal.js | 10 +- .../controlFlowGenericTypes.2.minified.js | 2 +- .../controlFlowIfStatement.1.normal.js | 6 +- .../controlFlowInOperator.1.normal.js | 12 +- .../controlFlowInOperator.2.minified.js | 2 +- ...lFlowInstanceOfGuardPrimitives.1.normal.js | 2 +- ...lowInstanceOfGuardPrimitives.2.minified.js | 2 +- .../controlFlowOptionalChain.1.normal.js | 6 +- .../controlFlowOptionalChain2.1.normal.js | 4 +- .../controlFlowTypeofObject.1.normal.js | 14 +- .../tsc-references/deleteChain.1.normal.js | 4 +- ...dClassIncludesInheritedMembers.1.normal.js | 10 +- ...lassIncludesInheritedMembers.2.minified.js | 6 +- ...lassOverridesProtectedMembers2.1.normal.js | 2 +- ...ssOverridesProtectedMembers2.2.minified.js | 2 +- ...vedClassOverridesPublicMembers.1.normal.js | 2 +- ...dClassOverridesPublicMembers.2.minified.js | 2 +- .../derivedClassTransitivity.1.normal.js | 2 +- .../derivedClassTransitivity.2.minified.js | 2 +- .../derivedClassTransitivity2.1.normal.js | 2 +- .../derivedClassTransitivity2.2.minified.js | 2 +- .../derivedClassTransitivity3.1.normal.js | 4 +- .../derivedClassTransitivity3.2.minified.js | 2 +- .../derivedClassTransitivity4.1.normal.js | 2 +- .../derivedClassTransitivity4.2.minified.js | 2 +- .../derivedClassWithAny.1.normal.js | 8 +- ...anceShadowingProtectedInstance.1.normal.js | 4 +- ...nstanceShadowingPublicInstance.1.normal.js | 4 +- ...tanceShadowingPublicInstance.2.minified.js | 4 +- ...StaticShadowingProtectedStatic.1.normal.js | 4 +- ...ateStaticShadowingPublicStatic.1.normal.js | 4 +- ...eStaticShadowingPublicStatic.2.minified.js | 4 +- ...lassWithoutExplicitConstructor.1.normal.js | 2 +- ...ssWithoutExplicitConstructor.2.minified.js | 2 +- ...assWithoutExplicitConstructor2.1.normal.js | 2 +- ...sWithoutExplicitConstructor2.2.minified.js | 2 +- ...assWithoutExplicitConstructor3.1.normal.js | 6 +- ...sWithoutExplicitConstructor3.2.minified.js | 6 +- .../derivedGenericClassWithAny.1.normal.js | 4 +- ...dAssignment5SiblingInitializer.1.normal.js | 10 +- ...dAssignment9SiblingInitializer.1.normal.js | 12 +- ...ructuringParameterDeclaration8.1.normal.js | 14 +- ...cturingParameterDeclaration8.2.minified.js | 12 +- ...turingWithLiteralInitializers2.1.normal.js | 30 +- .../discriminatedUnionInference.1.normal.js | 4 +- .../discriminatedUnionInference.2.minified.js | 4 +- .../discriminatedUnionTypes2.1.normal.js | 6 +- .../tsc-references/enumBasics.1.normal.js | 8 +- .../tsc-references/enumBasics.2.minified.js | 2 +- .../tsc-references/enumMerging.1.normal.js | 12 +- .../enumMergingErrors.1.normal.js | 6 +- .../tests/tsc-references/enumTag.1.normal.js | 2 +- .../enumTagImported.1.normal.js | 8 +- .../enumTagImported.2.minified.js | 4 +- .../tests/tsc-references/enums.1.normal.js | 2 +- .../tests/tsc-references/enums.2.minified.js | 2 +- .../errorSuperPropertyAccess.1.normal.js | 16 +- ...peWithAnnotationAndInitializer.1.normal.js | 4 +- ...nnotationAndInvalidInitializer.1.normal.js | 6 +- .../everyTypeWithInitializer.1.normal.js | 2 +- .../exhaustiveSwitchStatements1.1.normal.js | 10 +- ...exportAsNamespace1(module=es6).1.normal.js | 4 +- ...portAsNamespace1(module=es6).2.minified.js | 4 +- ...exportAsNamespace2(module=es6).1.normal.js | 4 +- ...portAsNamespace2(module=es6).2.minified.js | 4 +- ...exportAsNamespace3(module=es6).1.normal.js | 4 +- ...portAsNamespace3(module=es6).2.minified.js | 4 +- ...exportAsNamespace4(module=es6).1.normal.js | 8 +- ...portAsNamespace4(module=es6).2.minified.js | 8 +- .../exportAsNamespace_nonExistent.1.normal.js | 2 +- ...xportAsNamespace_nonExistent.2.minified.js | 2 +- .../tsc-references/exportBinding.1.normal.js | 4 +- .../exportBinding.2.minified.js | 4 +- ...ortDeclaration_moduleSpecifier.1.normal.js | 2 +- ...tDeclaration_moduleSpecifier.2.minified.js | 2 +- .../exportDefaultNamespace.1.normal.js | 4 +- .../exportDefaultNamespace.2.minified.js | 4 +- .../exportImportAlias.1.normal.js | 4 +- .../exportImportAlias.2.minified.js | 4 +- .../exportNamespace1.1.normal.js | 4 +- .../exportNamespace1.2.minified.js | 4 +- .../exportNamespace11.1.normal.js | 2 +- .../exportNamespace11.2.minified.js | 2 +- .../exportNamespace12.1.normal.js | 4 +- .../exportNamespace12.2.minified.js | 4 +- .../exportNamespace3.1.normal.js | 4 +- .../exportNamespace3.2.minified.js | 4 +- .../exportNamespace4.1.normal.js | 4 +- .../exportNamespace4.2.minified.js | 4 +- .../exportNamespace_js.1.normal.js | 2 +- .../exportNamespace_js.2.minified.js | 2 +- .../exportNestedNamespaces.1.normal.js | 2 +- .../exportNestedNamespaces.2.minified.js | 2 +- .../exportNestedNamespaces2.1.normal.js | 6 +- .../exportNestedNamespaces2.2.minified.js | 6 +- .../exportedAliasedEnumTag.1.normal.js | 2 +- .../exportedAliasedEnumTag.2.minified.js | 2 +- .../extendBooleanInterface.1.normal.js | 6 +- .../extendBooleanInterface.2.minified.js | 2 +- .../extendNumberInterface.1.normal.js | 6 +- .../extendNumberInterface.2.minified.js | 2 +- .../extendStringInterface.1.normal.js | 8 +- .../extendStringInterface.2.minified.js | 2 +- .../filterNamespace_import.1.normal.js | 2 +- .../fixSignatureCaching.1.normal.js | 214 ++++---- .../fixSignatureCaching.2.minified.js | 136 ++--- .../for-inStatements.1.normal.js | 2 +- .../tsc-references/forStatements.1.normal.js | 4 +- ...rStatementsMultipleInvalidDecl.1.normal.js | 4 +- ...forStatementsMultipleValidDecl.1.normal.js | 6 +- .../tsc-references/functionCalls.1.normal.js | 10 +- .../functionCalls.2.minified.js | 2 +- .../functionImplementationErrors.1.normal.js | 8 +- ...onWithMultipleReturnStatements.1.normal.js | 10 +- ...nericCallTypeArgumentInference.1.normal.js | 22 +- ...ricCallTypeArgumentInference.2.minified.js | 4 +- ...enericCallWithArrayLiteralArgs.1.normal.js | 6 +- ...CallWithFunctionTypedArguments.1.normal.js | 34 +- ...allWithFunctionTypedArguments2.1.normal.js | 8 +- ...lWithFunctionTypedArguments2.2.minified.js | 2 +- ...allWithFunctionTypedArguments5.1.normal.js | 12 +- ...lWithFunctionTypedArguments5.2.minified.js | 12 +- ...lWithGenericSignatureArguments.1.normal.js | 4 +- ...WithGenericSignatureArguments2.1.normal.js | 4 +- ...WithGenericSignatureArguments3.1.normal.js | 38 +- ...nericCallWithObjectLiteralArgs.1.normal.js | 4 +- ...ricCallWithObjectLiteralArgs.2.minified.js | 4 +- ...hObjectTypeArgsAndConstraints4.1.normal.js | 2 +- ...bjectTypeArgsAndConstraints4.2.minified.js | 2 +- ...lWithObjectTypeArgsAndIndexers.1.normal.js | 2 +- ...bjectTypeArgsAndIndexersErrors.1.normal.js | 2 +- ...ObjectTypeArgsAndStringIndexer.1.normal.js | 4 +- ...erloadedFunctionTypedArguments.1.normal.js | 6 +- ...rloadedFunctionTypedArguments2.1.normal.js | 2 +- ...thFunctionTypedMemberArguments.1.normal.js | 32 +- ...FunctionTypedMemberArguments.2.minified.js | 20 +- .../genericRestParameters1.1.normal.js | 8 +- .../genericRestParameters1.2.minified.js | 2 +- ...hCommonJSAssignmentDeclaration.1.normal.js | 2 +- ...ommonJSAssignmentDeclaration.2.minified.js | 2 +- .../globalThisAmbientModules.1.normal.js | 2 +- ...lobalThisBlockscopedProperties.1.normal.js | 6 +- .../globalThisUnknown.1.normal.js | 6 +- ...globalThisUnknownNoImplicitAny.1.normal.js | 6 +- .../heterogeneousArrayLiterals.1.normal.js | 18 +- .../ifDoWhileStatements.1.normal.js | 24 +- .../ifDoWhileStatements.2.minified.js | 4 +- .../importAliasModuleExports.1.normal.js | 2 +- .../importAliasModuleExports.2.minified.js | 2 +- ...rtCallExpressionAsyncES5System.1.normal.js | 10 +- ...CallExpressionAsyncES5System.2.minified.js | 10 +- ...mportCallExpressionAsyncES5UMD.1.normal.js | 10 +- ...ortCallExpressionAsyncES5UMD.2.minified.js | 10 +- .../importClause_default.1.normal.js | 2 +- ...mportEmptyFromModuleNotExisted.1.normal.js | 2 +- ...ortEmptyFromModuleNotExisted.2.minified.js | 2 +- .../importsNotUsedAsValues_error.1.normal.js | 4 +- ...importsNotUsedAsValues_error.2.minified.js | 4 +- .../inOperatorWithValidOperands.1.normal.js | 2 +- ...opertiesInheritedIntoClassType.1.normal.js | 4 +- ...ertiesInheritedIntoClassType.2.minified.js | 2 +- .../instancePropertyInClassType.1.normal.js | 4 +- .../instancePropertyInClassType.2.minified.js | 2 +- ...eofOperatorWithInvalidOperands.1.normal.js | 6 +- ...fOperatorWithInvalidOperands.2.minified.js | 2 +- ...adedCallAndConstructSignatures.1.normal.js | 4 +- ...edCallAndConstructSignatures.2.minified.js | 2 +- ...terfaceWithPropertyOfEveryType.1.normal.js | 2 +- ...izedCallAndConstructSignatures.1.normal.js | 8 +- ...edCallAndConstructSignatures.2.minified.js | 2 +- .../intersectionAsWeakTypeSource.1.normal.js | 2 +- .../intersectionReduction.1.normal.js | 8 +- .../intersectionReductionStrict.1.normal.js | 8 +- .../intersectionTypeInference2.1.normal.js | 4 +- .../intersectionTypeInference2.2.minified.js | 2 +- .../intersectionTypeMembers.1.normal.js | 12 +- ...intlNumberFormatES5UseGrouping.1.normal.js | 12 +- ...tlNumberFormatES5UseGrouping.2.minified.js | 12 +- .../intraExpressionInferences.1.normal.js | 2 +- .../intrinsicKeyword.1.normal.js | 2 +- .../invalidAssignmentsToVoid.1.normal.js | 2 +- .../invalidEnumAssignments.1.normal.js | 2 +- ...idMultipleVariableDeclarations.1.normal.js | 4 +- .../invalidStringAssignments.1.normal.js | 2 +- .../invalidStringAssignments.2.minified.js | 2 +- .../invalidUndefinedValues.1.normal.js | 2 +- .../invalidVoidValues.1.normal.js | 2 +- .../isomorphicMappedTypeInference.1.normal.js | 8 +- ...clarationsCommonjsRelativePath.1.normal.js | 6 +- ...arationsCommonjsRelativePath.2.minified.js | 2 +- ...eclarationsDocCommentsOnConsts.1.normal.js | 2 +- ...larationsDocCommentsOnConsts.2.minified.js | 2 +- .../jsDeclarationsEnumTag.1.normal.js | 2 +- ...xportAssignmentWithKeywordName.1.normal.js | 4 +- ...ortAssignmentWithKeywordName.2.minified.js | 4 +- ...DeclarationsReexportedCjsAlias.1.normal.js | 2 +- ...clarationsReexportedCjsAlias.2.minified.js | 2 +- ...erenceToClassInstanceCrossFile.1.normal.js | 2 +- ...enceToClassInstanceCrossFile.2.minified.js | 2 +- ...hExplicitNoArgumentConstructor.1.normal.js | 2 +- ...xplicitNoArgumentConstructor.2.minified.js | 2 +- ...defPropertyAndExportAssignment.1.normal.js | 10 +- ...fPropertyAndExportAssignment.2.minified.js | 10 +- .../keyofAndIndexedAccess.1.normal.js | 46 +- .../keyofAndIndexedAccessErrors.1.normal.js | 4 +- ...eyofInferenceIntersectsResults.1.normal.js | 6 +- ...ofInferenceIntersectsResults.2.minified.js | 2 +- .../literalTypeWidening.1.normal.js | 12 +- .../literalTypeWidening.2.minified.js | 2 +- .../literalTypesAndDestructuring.1.normal.js | 2 +- ...rExpressionIsContextuallyTyped.1.normal.js | 4 +- ...alOrOperatorWithTypeParameters.1.normal.js | 2 +- .../mappedTypeErrors.1.normal.js | 6 +- ...rFunctionsWithPrivateOverloads.1.normal.js | 2 +- ...unctionsWithPrivateOverloads.2.minified.js | 2 +- .../mergedInterfacesWithIndexers.1.normal.js | 4 +- ...mergedInterfacesWithIndexers.2.minified.js | 2 +- .../moduleExportAlias4.1.normal.js | 2 +- .../moduleExportAlias4.2.minified.js | 2 +- .../moduleExportAssignment.1.normal.js | 6 +- .../moduleExportAssignment.2.minified.js | 4 +- .../moduleExportAssignment3.1.normal.js | 2 +- .../moduleExportAssignment3.2.minified.js | 2 +- .../moduleExportAssignment4.1.normal.js | 2 +- .../moduleExportDuplicateAlias.1.normal.js | 2 +- .../moduleExportDuplicateAlias.2.minified.js | 2 +- .../moduleExportDuplicateAlias2.1.normal.js | 2 +- .../moduleExportDuplicateAlias2.2.minified.js | 2 +- .../moduleExportDuplicateAlias3.1.normal.js | 4 +- .../moduleExportDuplicateAlias3.2.minified.js | 4 +- .../moduleExportNestedNamespaces.1.normal.js | 2 +- ...moduleExportNestedNamespaces.2.minified.js | 2 +- ...rtWithExportPropertyAssignment.1.normal.js | 2 +- ...WithExportPropertyAssignment.2.minified.js | 2 +- ...tWithExportPropertyAssignment2.1.normal.js | 2 +- ...ithExportPropertyAssignment2.2.minified.js | 2 +- ...tWithExportPropertyAssignment3.1.normal.js | 8 +- ...ithExportPropertyAssignment3.2.minified.js | 6 +- ...tWithExportPropertyAssignment4.1.normal.js | 8 +- ...ithExportPropertyAssignment4.2.minified.js | 4 +- ...oduleWithStatementsOfEveryKind.1.normal.js | 8 +- ...uleWithStatementsOfEveryKind.2.minified.js | 4 +- .../multipleDeclarations.1.normal.js | 4 +- .../multipleDeclarations.2.minified.js | 4 +- .../multipleNumericIndexers.1.normal.js | 4 +- .../multipleStringIndexers.1.normal.js | 2 +- .../tsc-references/nameCollision.1.normal.js | 4 +- .../nameCollision.2.minified.js | 2 +- ...espaceAssignmentToRequireAlias.1.normal.js | 2 +- ...paceAssignmentToRequireAlias.2.minified.js | 2 +- .../namespaceMemberAccess.1.normal.js | 2 +- .../namespaceMemberAccess.2.minified.js | 2 +- .../nestedDestructuringOfRequire.1.normal.js | 2 +- ...nestedDestructuringOfRequire.2.minified.js | 2 +- .../neverReturningFunctions1.1.normal.js | 6 +- .../neverReturningFunctions1.2.minified.js | 6 +- .../tests/tsc-references/noInfer.1.normal.js | 20 +- .../tsc-references/noInfer.2.minified.js | 16 +- .../nonPrimitiveNarrow.1.normal.js | 4 +- .../nonPrimitiveNarrow.2.minified.js | 2 +- .../nonPrimitiveUnionIntersection.1.normal.js | 4 +- ...ubtypeOfEverythingButUndefined.1.normal.js | 4 +- .../nullishCoalescingOperator1.1.normal.js | 8 +- .../nullishCoalescingOperator10.1.normal.js | 2 +- .../nullishCoalescingOperator2.1.normal.js | 18 +- .../nullishCoalescingOperator3.1.normal.js | 2 +- .../nullishCoalescingOperator7.1.normal.js | 6 +- .../nullishCoalescingOperator7.2.minified.js | 2 +- ...hCoalescingOperator_not_strict.1.normal.js | 18 +- .../numberPropertyAccess.1.normal.js | 6 +- .../numberPropertyAccess.2.minified.js | 2 +- ...ConstrainsPropertyDeclarations.1.normal.js | 16 +- ...onstrainsPropertyDeclarations2.1.normal.js | 6 +- ...strainsPropertyDeclarations2.2.minified.js | 4 +- .../numericIndexingResults.1.normal.js | 42 +- .../numericIndexingResults.2.minified.js | 14 +- .../numericStringLiteralTypes.1.normal.js | 2 +- .../numericStringLiteralTypes.2.minified.js | 2 +- ...objectLiteralGettersAndSetters.1.normal.js | 36 +- .../objectLiteralNormalization.1.normal.js | 4 +- .../objectRestParameterES5.1.normal.js | 6 +- .../objectRestParameterES5.2.minified.js | 6 +- .../objectRestReadonly.1.normal.js | 6 +- .../objectRestReadonly.2.minified.js | 6 +- .../tsc-references/objectSpread.1.normal.js | 50 +- .../tsc-references/objectSpread.2.minified.js | 30 +- ...eHidingMembersOfExtendedObject.1.normal.js | 12 +- .../objectTypePropertyAccess.1.normal.js | 14 +- .../objectTypePropertyAccess.2.minified.js | 2 +- ...idingMembersOfExtendedFunction.1.normal.js | 4 +- ...idingMembersOfExtendedFunction.1.normal.js | 4 +- .../objectTypeWithNumericProperty.1.normal.js | 16 +- ...bjectTypeWithNumericProperty.2.minified.js | 4 +- ...ringIndexerHidingObjectIndexer.1.normal.js | 8 +- ...ngIndexerHidingObjectIndexer.2.minified.js | 2 +- ...medPropertyOfIllegalCharacters.1.normal.js | 10 +- ...dPropertyOfIllegalCharacters.2.minified.js | 6 +- .../objectTypesIdentity.1.normal.js | 2 +- ...ypesIdentityWithCallSignatures.1.normal.js | 2 +- ...pesIdentityWithCallSignatures2.1.normal.js | 2 +- ...SignaturesDifferingParamCounts.1.normal.js | 2 +- ...ithCallSignaturesWithOverloads.1.normal.js | 2 +- ...entityWithConstructSignatures2.1.normal.js | 2 +- ...SignaturesDifferingParamCounts.1.normal.js | 2 +- ...gnaturesDifferingByConstraints.1.normal.js | 2 +- ...naturesDifferingByConstraints2.1.normal.js | 2 +- ...naturesDifferingByConstraints3.1.normal.js | 2 +- ...gnaturesDifferingByConstraints.1.normal.js | 2 +- ...naturesDifferingByConstraints2.1.normal.js | 2 +- ...naturesDifferingByConstraints3.1.normal.js | 2 +- ...esIdentityWithNumericIndexers1.1.normal.js | 2 +- ...esIdentityWithNumericIndexers3.1.normal.js | 2 +- ...ctTypesIdentityWithOptionality.1.normal.js | 2 +- ...bjectTypesIdentityWithPrivates.1.normal.js | 2 +- ...objectTypesIdentityWithPublics.1.normal.js | 2 +- ...ypesIdentityWithStringIndexers.1.normal.js | 2 +- .../optionalChainingInLoop.1.normal.js | 2 +- .../optionalChainingInLoop.2.minified.js | 2 +- .../overloadResolution.1.normal.js | 26 +- ...oadResolutionClassConstructors.1.normal.js | 26 +- ...dResolutionClassConstructors.2.minified.js | 6 +- ...overloadResolutionConstructors.1.normal.js | 26 +- ...erloadResolutionConstructors.2.minified.js | 2 +- .../paramTagOnCallExpression.1.normal.js | 2 +- .../paramTagOnCallExpression.2.minified.js | 2 +- ...ramTagOnFunctionUsingArguments.1.normal.js | 2 +- .../paramTagTypeResolution.1.normal.js | 2 +- .../paramTagTypeResolution.2.minified.js | 2 +- .../parserArgumentList1.1.normal.js | 2 +- .../parserArgumentList1.2.minified.js | 2 +- .../parserForInStatement8.1.normal.js | 8 +- .../parserForInStatement8.2.minified.js | 8 +- .../parserForStatement9.1.normal.js | 4 +- .../parserForStatement9.2.minified.js | 4 +- .../parserNotHexLiteral1.1.normal.js | 4 +- .../parserNotHexLiteral1.2.minified.js | 2 +- .../parserRealSource1.1.normal.js | 4 +- .../parserRealSource1.2.minified.js | 4 +- .../parserS7.2_A1.5_T2.1.normal.js | 4 +- .../parserS7.2_A1.5_T2.2.minified.js | 4 +- .../parserS7.3_A1.1_T2.1.normal.js | 2 +- .../parserS7.6_A4.2_T1.1.normal.js | 66 +-- .../tsc-references/parserUnicode1.1.normal.js | 4 +- .../parserUnicode1.2.minified.js | 4 +- .../tsc-references/parserindenter.1.normal.js | 14 +- .../parserindenter.2.minified.js | 14 +- ...sOfGenericConstructorFunctions.1.normal.js | 8 +- .../tsc-references/propertyAccess.1.normal.js | 36 +- .../propertyAccess.2.minified.js | 14 +- ...OnTypeParameterWithConstraints.1.normal.js | 8 +- ...nTypeParameterWithConstraints2.1.normal.js | 16 +- ...ypeParameterWithConstraints2.2.minified.js | 4 +- ...nTypeParameterWithConstraints3.1.normal.js | 16 +- ...ypeParameterWithConstraints3.2.minified.js | 4 +- ...nTypeParameterWithConstraints4.1.normal.js | 8 +- ...nTypeParameterWithConstraints5.1.normal.js | 12 +- ...ypeParameterWithConstraints5.2.minified.js | 4 +- ...ypeParameterWithoutConstraints.1.normal.js | 8 +- ...ertyAccessStringIndexSignature.1.normal.js | 2 +- ...tyAccessStringIndexSignature.2.minified.js | 2 +- ...ingIndexSignatureNoImplicitAny.1.normal.js | 2 +- ...gIndexSignatureNoImplicitAny.2.minified.js | 2 +- ...ertyAssignmentOnImportedSymbol.1.normal.js | 2 +- ...tyAssignmentOnImportedSymbol.2.minified.js | 2 +- ...mentOnUnresolvedImportedSymbol.1.normal.js | 2 +- ...ntOnUnresolvedImportedSymbol.2.minified.js | 2 +- .../propertyOverridesAccessors4.1.normal.js | 2 +- .../quotedConstructors.1.normal.js | 2 +- .../reExportJsFromTs.1.normal.js | 2 +- .../reExportJsFromTs.2.minified.js | 2 +- .../readonlyArraysAndTuples2.1.normal.js | 2 +- .../readonlyArraysAndTuples2.2.minified.js | 2 +- .../readonlyRestParameters.1.normal.js | 14 +- .../recursiveInitializer.1.normal.js | 4 +- .../recursiveTypeReferences1.1.normal.js | 28 +- .../recursiveTypeReferences1.2.minified.js | 18 +- .../recursiveTypesWithTypeof.1.normal.js | 2 +- .../recursiveTypesWithTypeof.2.minified.js | 2 +- .../requireAssertsFromTypescript.1.normal.js | 4 +- ...requireAssertsFromTypescript.2.minified.js | 2 +- .../requireOfESWithPropertyAccess.1.normal.js | 2 +- ...equireOfESWithPropertyAccess.2.minified.js | 2 +- .../restTuplesFromContextualTypes.1.normal.js | 2 +- ...estTuplesFromContextualTypes.2.minified.js | 2 +- .../returnStatements.1.normal.js | 2 +- .../returnTagTypeGuard.1.normal.js | 2 +- ...erNonAsciiHorizontalWhitespace.1.normal.js | 4 +- .../scannerS7.2_A1.5_T2.1.normal.js | 4 +- .../scannerS7.2_A1.5_T2.2.minified.js | 4 +- .../scannerS7.3_A1.1_T2.1.normal.js | 2 +- .../scannerS7.6_A4.2_T1.1.normal.js | 66 +-- ...alWithContainingNullCharacter1.1.normal.js | Bin 67 -> 66 bytes .../spellingUncheckedJS.1.normal.js | 4 +- .../spellingUncheckedJS.2.minified.js | 2 +- ...spreadOverwritesPropertyStrict.1.normal.js | 4 +- .../staticPropertyNotInClassType.1.normal.js | 6 +- ...staticPropertyNotInClassType.2.minified.js | 4 +- ...ConstrainsPropertyDeclarations.1.normal.js | 16 +- ...onstrainsPropertyDeclarations2.1.normal.js | 4 +- .../stringIndexingResults.1.normal.js | 20 +- .../stringIndexingResults.2.minified.js | 2 +- .../stringLiteralTypesAndTuples01.1.normal.js | 2 +- ...tringLiteralTypesAndTuples01.2.minified.js | 2 +- .../stringLiteralTypesOverloads01.1.normal.js | 2 +- ...tringLiteralTypesOverloads01.2.minified.js | 2 +- .../stringLiteralTypesOverloads02.1.normal.js | 2 +- ...tringLiteralTypesOverloads02.2.minified.js | 2 +- .../stringNamedPropertyAccess.1.normal.js | 2 +- .../stringPropertyAccess.1.normal.js | 8 +- .../stringPropertyAccess.2.minified.js | 2 +- .../stringPropertyAccessWithError.1.normal.js | 4 +- .../subtypesOfTypeParameter.1.normal.js | 4 +- ...fTypeParameterWithConstraints2.1.normal.js | 4 +- .../subtypingWithCallSignatures.1.normal.js | 4 +- .../subtypingWithCallSignatures.2.minified.js | 4 +- .../subtypingWithCallSignatures2.1.normal.js | 8 +- ...subtypingWithCallSignatures2.2.minified.js | 2 +- .../subtypingWithCallSignatures3.1.normal.js | 6 +- ...subtypingWithCallSignatures3.2.minified.js | 2 +- .../subtypingWithCallSignatures4.1.normal.js | 8 +- ...subtypingWithCallSignatures4.2.minified.js | 4 +- .../subtypingWithCallSignaturesA.1.normal.js | 2 +- ...subtypingWithCallSignaturesA.2.minified.js | 2 +- .../tsc-references/superCalls.1.normal.js | 6 +- .../superPropertyAccessNoError.1.normal.js | 2 +- .../superPropertyAccessNoError.2.minified.js | 2 +- .../switchBreakStatements.1.normal.js | 44 +- .../switchStatements.1.normal.js | 20 +- .../switchStatements.2.minified.js | 8 +- ...tchWithConstrainedTypeVariable.1.normal.js | 2 +- ...teStringsTypeArgumentInference.1.normal.js | 10 +- ...StringsWithOverloadResolution3.1.normal.js | 16 +- .../templateLiteralTypes2.1.normal.js | 4 +- .../templateLiteralTypes3.1.normal.js | 40 +- ...hisPropertyAssignmentInherited.1.normal.js | 2 +- ...sPropertyAssignmentInherited.2.minified.js | 2 +- .../tests/tsc-references/thisTag1.1.normal.js | 2 +- .../tsc-references/thisTag1.2.minified.js | 2 +- .../thisTypeInTypePredicate.1.normal.js | 2 +- .../thisTypeInTypePredicate.2.minified.js | 2 +- .../throwInEnclosingStatements.1.normal.js | 2 +- .../throwStatements.1.normal.js | 12 +- .../ts-expect-error.1.normal.js | 26 +- .../tsc-references/ts-ignore.1.normal.js | 16 +- ...sNoCheckForTypescriptComments1.1.normal.js | 2 +- ...oCheckForTypescriptComments1.2.minified.js | 2 +- .../tsxAttributeErrors.1.normal.js | 4 +- .../tsxAttributeResolution1.1.normal.js | 4 +- .../tsxAttributeResolution3.1.normal.js | 6 +- .../tsxAttributeResolution3.2.minified.js | 2 +- .../tsxAttributeResolution7.1.normal.js | 4 +- .../tsxDynamicTagName5.1.normal.js | 4 +- .../tsxDynamicTagName5.2.minified.js | 4 +- .../tsxDynamicTagName6.1.normal.js | 2 +- .../tsxDynamicTagName7.1.normal.js | 4 +- .../tsxDynamicTagName7.2.minified.js | 4 +- .../tsxDynamicTagName8.1.normal.js | 4 +- .../tsxDynamicTagName8.2.minified.js | 4 +- .../tsxDynamicTagName9.1.normal.js | 4 +- .../tsxDynamicTagName9.2.minified.js | 4 +- .../tsxElementResolution12.1.normal.js | 2 +- .../tsxReactEmitEntities.1.normal.js | 2 +- .../tsc-references/tsxTypeErrors.1.normal.js | 2 +- .../typeArgumentInference.1.normal.js | 20 +- ...ntInferenceConstructSignatures.1.normal.js | 28 +- ...InferenceConstructSignatures.2.minified.js | 24 +- .../typeArgumentInferenceErrors.1.normal.js | 8 +- ...gumentInferenceWithConstraints.1.normal.js | 28 +- .../typeFromJSConstructor.1.normal.js | 10 +- .../typeFromJSConstructor.2.minified.js | 6 +- .../typeFromJSInitializer.1.normal.js | 16 +- .../typeFromJSInitializer.2.minified.js | 2 +- .../typeFromJSInitializer4.1.normal.js | 6 +- .../typeFromPropertyAssignment17.1.normal.js | 2 +- ...typeFromPropertyAssignment17.2.minified.js | 2 +- .../typeFromPropertyAssignment21.1.normal.js | 2 +- ...typeFromPropertyAssignment21.2.minified.js | 2 +- .../typeFromPropertyAssignment22.1.normal.js | 2 +- .../typeFromPropertyAssignment23.1.normal.js | 4 +- ...typeFromPropertyAssignment23.2.minified.js | 2 +- .../typeFromPropertyAssignment24.1.normal.js | 2 +- .../typeFromPropertyAssignment36.1.normal.js | 4 +- ...typeFromPropertyAssignment36.2.minified.js | 2 +- .../typeFromPropertyAssignment37.1.normal.js | 2 +- ...typeFromPropertyAssignment37.2.minified.js | 2 +- .../typeFromPrototypeAssignment3.1.normal.js | 4 +- ...typeFromPrototypeAssignment3.2.minified.js | 4 +- .../typeFromPrototypeAssignment4.1.normal.js | 2 +- ...typeFromPrototypeAssignment4.2.minified.js | 2 +- .../typeGuardIntersectionTypes.1.normal.js | 2 +- .../typeGuardNesting.1.normal.js | 20 +- .../typeGuardOfFormTypeOfFunction.1.normal.js | 4 +- .../typeGuardsAsAssertions.1.normal.js | 4 +- .../typeGuardsAsAssertions.2.minified.js | 4 +- .../typeOfThisInStaticMembers.1.normal.js | 2 +- .../typeOfThisInStaticMembers.2.minified.js | 2 +- ...meterAsTypeParameterConstraint.1.normal.js | 4 +- ...eterAsTypeParameterConstraint2.1.normal.js | 6 +- ...arameterConstraintTransitively.1.normal.js | 10 +- ...rameterConstraintTransitively2.1.normal.js | 6 +- .../typeQueryOnClass.1.normal.js | 2 +- .../typeQueryOnClass.2.minified.js | 2 +- .../typeTagNoErasure.1.normal.js | 2 +- .../typeTagNoErasure.2.minified.js | 2 +- .../typeTagOnPropertyAssignment.1.normal.js | 2 +- .../typedefCrossModule.1.normal.js | 2 +- .../typedefCrossModule2.1.normal.js | 2 +- .../typedefCrossModule2.2.minified.js | 2 +- ...typedefOnSemicolonClassElement.1.normal.js | 2 +- ...pedefOnSemicolonClassElement.2.minified.js | 2 +- .../tsc-references/typedefScope1.1.normal.js | 2 +- .../typedefTagExtraneousProperty.1.normal.js | 2 +- .../typedefTagNested.1.normal.js | 8 +- .../typeofANonExportedType.1.normal.js | 4 +- .../typeofANonExportedType.2.minified.js | 2 +- .../typeofImportTypeOnlyExport.1.normal.js | 2 +- .../typeofImportTypeOnlyExport.2.minified.js | 2 +- .../tsc-references/typeofThis.1.normal.js | 10 +- .../typesWithOptionalProperty.1.normal.js | 8 +- ...sWithSpecializedCallSignatures.1.normal.js | 6 +- ...ithSpecializedCallSignatures.2.minified.js | 2 +- ...SpecializedConstructSignatures.1.normal.js | 8 +- ...ecializedConstructSignatures.2.minified.js | 2 +- ...ExtendedEscapesInStrings01_ES5.1.normal.js | 2 +- ...ExtendedEscapesInStrings02_ES5.1.normal.js | 2 +- ...ExtendedEscapesInStrings03_ES5.1.normal.js | 2 +- ...ExtendedEscapesInStrings04_ES5.1.normal.js | 2 +- ...ExtendedEscapesInStrings05_ES5.1.normal.js | 2 +- ...ExtendedEscapesInStrings06_ES5.1.normal.js | 2 +- ...ExtendedEscapesInStrings08_ES5.1.normal.js | 2 +- ...ExtendedEscapesInStrings09_ES5.1.normal.js | 2 +- ...ExtendedEscapesInStrings13_ES5.1.normal.js | 2 +- ...ExtendedEscapesInStrings15_ES5.1.normal.js | 2 +- ...ExtendedEscapesInStrings16_ES5.1.normal.js | 2 +- ...ExtendedEscapesInStrings18_ES5.1.normal.js | 2 +- ...ExtendedEscapesInStrings23_ES5.1.normal.js | 2 +- .../unionTypeCallSignatures.1.normal.js | 42 +- .../unionTypeCallSignatures.2.minified.js | 2 +- .../unionTypeConstructSignatures.1.normal.js | 44 +- ...unionTypeConstructSignatures.2.minified.js | 2 +- .../unionTypeReduction2.1.normal.js | 16 +- .../unknownControlFlow.1.normal.js | 22 +- .../tsc-references/unknownType2.1.normal.js | 20 +- ...idMultipleVariableDeclarations.1.normal.js | 6 +- .../validStringAssignments.1.normal.js | 2 +- .../varRequireFromJavascript.1.normal.js | 2 +- .../varRequireFromJavascript.2.minified.js | 2 +- .../varRequireFromTypescript.1.normal.js | 2 +- .../varRequireFromTypescript.2.minified.js | 2 +- .../variadicTuples1.1.normal.js | 96 ++-- .../variadicTuples1.2.minified.js | 48 +- ...atimModuleSyntaxConstEnumUsage.1.normal.js | 2 +- ...imModuleSyntaxConstEnumUsage.2.minified.js | 2 +- .../tests/tsc-references/witness.1.normal.js | 10 +- ...rappedAndRecursiveConstraints2.1.normal.js | 2 +- ...ppedAndRecursiveConstraints2.2.minified.js | 2 +- ...rappedAndRecursiveConstraints3.1.normal.js | 4 +- ...ppedAndRecursiveConstraints3.2.minified.js | 2 +- ...rappedAndRecursiveConstraints4.1.normal.js | 4 +- ...ppedAndRecursiveConstraints4.2.minified.js | 2 +- .../tests/vercel/full/utf8-1/output/index.js | 30 +- .../next-39460/output/snippetSession.js | 50 +- crates/swc_ecma_codegen/src/lib.rs | 2 +- crates/swc_ecma_codegen/src/tests.rs | 6 +- .../tests/test262/00b851b06af02cc0.js | 4 +- .../tests/test262/070d82d1b3b3a975.js | 2 +- .../tests/test262/071f05b40ea0163f.js | 6 +- .../tests/test262/0aeb95f62766e684.js | 2 +- .../tests/test262/0b1fc7208759253b.js | 2 +- .../tests/test262/0b281915a3227177.js | 2 +- .../tests/test262/110fa1efdd0868b8.js | 3 +- .../tests/test262/12e59b6d403833ae.js | 2 +- .../tests/test262/1450a897a4ba83a7.js | 4 +- .../tests/test262/15dfd62aa10c8b18.js | 2 +- .../tests/test262/17d63bb0b9482189.js | 2 +- .../tests/test262/17d881105a9a6c85.js | 2 +- .../tests/test262/1ca991b39b6e7754.js | 2 +- .../tests/test262/1e3f57c4ec83f5bc.js | 2 +- .../tests/test262/1e61843633dcb483.js | 2 +- .../tests/test262/20644d335e3cd008.js | 2 +- .../tests/test262/20aca21e32bf7772.js | 2 +- .../tests/test262/218e751b8b453b9b.js | 2 +- .../tests/test262/230da70c908c1859.js | 2 +- .../tests/test262/242ede66951e11b1.js | 2 +- .../tests/test262/25542e65ad9d2bf1.js | 2 +- .../tests/test262/25fd48ccc3bef96a.js | 2 +- .../tests/test262/264266c68369c672.js | 2 +- .../tests/test262/27ca96102da82628.js | 2 +- .../tests/test262/2a7d131074016ba6.js | 2 +- .../tests/test262/2b9d4a632590814a.js | 2 +- .../tests/test262/2c4b264884006a8e.js | 2 +- .../tests/test262/2d10fed2af94fbd1.js | 2 +- .../tests/test262/2e371094f1b1ac51.js | 2 +- .../tests/test262/2e5fbf7b1685fa1b.js | 2 +- .../tests/test262/3098b57020860587.js | 2 +- .../tests/test262/30aee1020fc69090.js | 2 +- .../tests/test262/3156a92ca5319b8b.js | 2 +- .../tests/test262/317532451c2ce8ff.js | 2 +- .../tests/test262/3315c524a740fe55.js | 2 +- .../tests/test262/3793ec99f844de1c.js | 4 +- .../tests/test262/37c0f5275362d1c9.js | 2 +- .../tests/test262/37d26e3bec6d9a0f.js | 2 +- .../tests/test262/3990bb94b19b1071.js | 2 +- .../tests/test262/3a1f039e533d1543.js | 2 +- .../tests/test262/3ae4f46daa688c58.js | 4 +- .../tests/test262/3b36d546985cd9cb.js | 3 +- .../tests/test262/3d2ab39608730a47.js | 4 +- .../tests/test262/3e48826018d23c85.js | 2 +- .../tests/test262/3eb2c2bf585c0916.js | 2 +- .../tests/test262/3f46ee1db509d55d.js | 2 +- .../tests/test262/3fb07536eb5aea8d.js | 2 +- .../tests/test262/40adcdf7cfe3fa0d.js | 2 +- .../tests/test262/4672c2ef688237c9.js | 2 +- .../tests/test262/47ea193a5fc3f2c7.js | 2 +- .../tests/test262/4a0d9236bc523b77.js | 2 +- .../tests/test262/4a79205bd8cd49d0.js | 2 +- .../tests/test262/4b346e8c85a29408.js | 2 +- .../tests/test262/4e07f8992cca7db0.js | 2 +- .../tests/test262/4fa08a62c2d8c495.js | 2 +- .../tests/test262/513275ce0e3c7ef3.js | 6 +- .../tests/test262/515825915b8d1cd8.js | 2 +- .../tests/test262/54fb77cb2384a86b.js | 2 +- .../tests/test262/5526c98fdf9150c1.js | 2 +- .../tests/test262/56dcd0733a23aa26.js | 4 +- .../tests/test262/575306c08cc44b10.js | 2 +- .../tests/test262/57971b49e239c0ff.js | 2 +- .../tests/test262/599dff255c5ec792.js | 2 +- .../tests/test262/5b146261dda66d63.js | 2 +- .../tests/test262/5b683275df4548d1.js | 2 +- .../tests/test262/5beffd72ddb47f13.js | 2 +- .../tests/test262/61d8a7e497b6db72.js | 2 +- .../tests/test262/627fede559e0bcac.js | 2 +- .../tests/test262/647e21f8f157c338.js | 2 +- .../tests/test262/664b0da1dd015106.js | 2 +- .../tests/test262/66aabbb5b00fb1ae.js | 2 +- .../tests/test262/68125aef6f5cc46f.js | 2 +- .../tests/test262/697b3d30c1d06918.js | 2 +- .../tests/test262/6edc155d463535cb.js | 2 +- .../tests/test262/717b2f65b69e809e.js | 2 +- .../tests/test262/71bcb4b846c22c58.js | 8 +- .../tests/test262/71e066a0fa01825b.js | 2 +- .../tests/test262/7305be27a0713dfa.js | 2 +- .../tests/test262/76a46be6c2f09fa3.js | 2 +- .../tests/test262/779e65d6349f1616.js | 2 +- .../tests/test262/77a541b0502d0bde.js | 3 +- .../tests/test262/78e1b8a4f3318967.js | 2 +- .../tests/test262/7b514406528ff126.js | 2 +- .../tests/test262/7c03e5eb6a9f6f1a.js | 2 +- .../tests/test262/7c9c0cce695bc705.js | 4 +- .../tests/test262/7d8b61ba2a3a275c.js | 2 +- .../tests/test262/7dfb625b91c5c879.js | 2 +- .../tests/test262/7e6e3b4c766a4d33.js | 2 +- .../tests/test262/7f88f149f16fe97a.js | 4 +- .../tests/test262/7fe89d8edf6e778a.js | 2 +- .../tests/test262/802658d6ef9a83ec.js | 2 +- .../tests/test262/81a0322e554af8da.js | 2 +- .../tests/test262/84f901eb37273117.js | 2 +- .../tests/test262/85263ecacc7a4dc5.js | 2 +- .../tests/test262/85d6723f13f33101.js | 2 +- .../tests/test262/88827d8021b5b3ab.js | 2 +- .../tests/test262/88c21621e3e8bba0.js | 2 +- .../tests/test262/8af69d8f15295ed2.js | 2 +- .../tests/test262/8d6ab6352a3f7fa0.js | 2 +- .../tests/test262/8e3f0660b32fbfd2.js | 2 +- .../tests/test262/8ef08a335a7f5966.js | 2 +- .../tests/test262/8f8bfb27569ac008.js | 2 +- .../tests/test262/95520bedf0fdd4c9.js | 2 +- .../tests/test262/955c5fedb3931500.js | 2 +- .../tests/test262/95ab0d795c04ff38.js | 2 +- .../tests/test262/9681f5d844d7acd0.js | 2 +- .../tests/test262/9ec644dbf797e95c.js | 2 +- .../tests/test262/a11e875c4dd100af.js | 2 +- .../tests/test262/a2042d86c592dd55.js | 2 +- .../tests/test262/a5a01023fef4d506.js | 8 +- .../tests/test262/a5b30a03e9c774af.js | 6 +- .../tests/test262/a62c6323a3696fa8.js | 3 +- .../tests/test262/ab452fc45813857a.js | 4 +- .../tests/test262/ade301f0d871c610.js | 2 +- .../tests/test262/afa63b136c835723.js | 2 +- .../tests/test262/afffb6d317e53b92.js | 2 +- .../tests/test262/b07c5fdc1003316b.js | 2 +- .../tests/test262/b1072e92becf06a9.js | 2 +- .../tests/test262/b4bc5f201c297bca.module.js | 2 +- .../tests/test262/b5cf21a87ec272d1.js | 2 +- .../tests/test262/b5d302467c6f2f16.js | 2 +- .../tests/test262/b6b5e49c97cedebb.js | 2 +- .../tests/test262/bd697f0fda948394.js | 2 +- .../tests/test262/be2fd5888f434cbd.js | 2 +- .../tests/test262/c1319833fc139cf8.js | 2 +- .../tests/test262/c52db35cba7fdbc0.js | 2 +- .../tests/test262/c7e5fba8bf3854cd.js | Bin 48 -> 47 bytes .../tests/test262/c8dbdecbde2c1869.js | 2 +- .../tests/test262/c963ac653b30699b.js | 2 +- .../tests/test262/cb095c303f88cd0b.js | 2 +- .../tests/test262/cdca52810bbe4532.js | 4 +- .../tests/test262/ce349e20cf388e87.js | 2 +- .../tests/test262/ce569e89a005c02a.js | 2 +- .../tests/test262/cf0eb6e6c4317c33.js | 2 +- .../tests/test262/d038789ad15922ff.js | 2 +- .../tests/test262/d2d8885e0c00ad51.js | 2 +- .../tests/test262/d38771967621cb8e.js | 2 +- .../tests/test262/d483926898410cae.js | 2 +- .../tests/test262/d57d9e2865e43807.js | 2 +- .../tests/test262/d61d161a9c36fa45.js | 2 +- .../tests/test262/d81d71f4121e3193.js | 2 +- .../tests/test262/d95e9ad32d562722.js | 2 +- .../tests/test262/d97144839fbdca91.js | 2 +- .../tests/test262/dc3afa2f13259ae0.js | 2 +- .../tests/test262/dd0e8f971ab4d6ab.js | 2 +- .../tests/test262/ddcd0bf839779a45.js | 2 +- .../tests/test262/e23748bdbb0713dc.js | 4 +- .../tests/test262/e290a32637ffdcb7.js | 2 +- .../tests/test262/e374d329af31c20a.js | 2 +- .../tests/test262/e65f3cca9a4637c3.js | 2 +- .../tests/test262/e84ef669246313d2.js | 4 +- .../tests/test262/e9682c37a1a959e1.js | 2 +- .../tests/test262/ecba8fb326c2c985.js | 14 +- .../tests/test262/ed0783c35e43032b.js | 2 +- .../tests/test262/ed65dd575be2b4ab.js | 4 +- .../tests/test262/f1218947a6a17e65.js | 2 +- .../tests/test262/f15772354efa5ecf.js | 2 +- .../tests/test262/f2d394b74219a023.js | 2 +- .../tests/test262/fa736f4b0cf19c0c.js | 2 +- .../tests/test262/fb7c5656640f6ec7.js | 2 +- .../tests/test262/fba24e17d16fd0c4.js | 2 +- .../tests/test262/fc286bf26373db8d.js | 2 +- .../tests/test262/fe5f0dcb8e902857.js | 4 +- .../tests/test262/fec4c4ff229d3fc2.js | 2 +- .../tests/test262/ff03d6d14c3f4007.js | 2 +- crates/swc_ecma_compat_es2015/src/lib.rs | 18 + .../src/lib.rs/issue_8871.js | 4 + node-swc/__tests__/spack/simple_test.js | 41 +- node-swc/__tests__/transform/api_test.js | 103 ++-- node-swc/__tests__/transform/experimental.mjs | 2 +- .../__tests__/transform/optimizer_test.js | 36 +- node-swc/src/binding.js | 500 +++++++++--------- 942 files changed, 3184 insertions(+), 3075 deletions(-) create mode 100644 crates/swc/tests/fixture/issues-8xxx/8863/input/.swcrc create mode 100644 crates/swc/tests/fixture/issues-8xxx/8863/input/1.js create mode 100644 crates/swc/tests/fixture/issues-8xxx/8863/output/1.js create mode 100644 crates/swc/tests/fixture/issues-8xxx/8871/input/.swcrc create mode 100644 crates/swc/tests/fixture/issues-8xxx/8871/input/1.js create mode 100644 crates/swc/tests/fixture/issues-8xxx/8871/output/1.js create mode 100644 crates/swc_ecma_compat_es2015/tests/__swc_snapshots__/src/lib.rs/issue_8871.js diff --git a/crates/swc/tests/fixture/globals/member-expr/precendence/output/index.js b/crates/swc/tests/fixture/globals/member-expr/precendence/output/index.js index dfac4e300058..439429eb0f28 100644 --- a/crates/swc/tests/fixture/globals/member-expr/precendence/output/index.js +++ b/crates/swc/tests/fixture/globals/member-expr/precendence/output/index.js @@ -2,4 +2,4 @@ console.log(true); if (true) { console.log("Pass"); } -console.log("foo"); +console.log('foo'); diff --git a/crates/swc/tests/fixture/issues-1xxx/1227/case-1/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1227/case-1/output/index.js index de235a7fd2b5..53db8f8fe1e7 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1227/case-1/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1227/case-1/output/index.js @@ -1 +1 @@ -var foo = "\xa0"; +var foo = "\u{a0}"; diff --git a/crates/swc/tests/fixture/issues-1xxx/1358/case2/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1358/case2/output/index.js index 7d113043611f..b9d7acefaa95 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1358/case2/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1358/case2/output/index.js @@ -1 +1 @@ -"''"; +"\'\'"; diff --git a/crates/swc/tests/fixture/issues-1xxx/1744/case1/output/index.js b/crates/swc/tests/fixture/issues-1xxx/1744/case1/output/index.js index 322d2a6c3f77..e803c3775634 100644 --- a/crates/swc/tests/fixture/issues-1xxx/1744/case1/output/index.js +++ b/crates/swc/tests/fixture/issues-1xxx/1744/case1/output/index.js @@ -1 +1 @@ -console.log("\uD83E\uDD2D \xfc"); +console.log("🤭 ü"); diff --git a/crates/swc/tests/fixture/issues-5xxx/5068/1/output/index.js b/crates/swc/tests/fixture/issues-5xxx/5068/1/output/index.js index df157fafe3a0..c0b97cb057eb 100644 --- a/crates/swc/tests/fixture/issues-5xxx/5068/1/output/index.js +++ b/crates/swc/tests/fixture/issues-5xxx/5068/1/output/index.js @@ -17,7 +17,7 @@ function _templateObject1() { }; return data; } -import styled from "styled-components"; +import styled from 'styled-components'; var C1 = styled.div(_templateObject()); var C2 = styled.div(_templateObject1()); -var debug = eval(""); +var debug = eval(''); diff --git a/crates/swc/tests/fixture/issues-5xxx/5068/2/output/index.js b/crates/swc/tests/fixture/issues-5xxx/5068/2/output/index.js index 3b88ebdebb68..86bf14e1cc8f 100644 --- a/crates/swc/tests/fixture/issues-5xxx/5068/2/output/index.js +++ b/crates/swc/tests/fixture/issues-5xxx/5068/2/output/index.js @@ -17,7 +17,7 @@ function _templateObject1() { }; return n; } -import styled from "styled-components"; +import styled from 'styled-components'; var C1 = styled.div(_templateObject()); var C2 = styled.div(_templateObject1()); -var debug = eval(""); +var debug = eval(''); diff --git a/crates/swc/tests/fixture/issues-5xxx/5214/1/output/src/foo.bar.baz.js b/crates/swc/tests/fixture/issues-5xxx/5214/1/output/src/foo.bar.baz.js index 09d7ec711e60..4d2334ef3f3e 100644 --- a/crates/swc/tests/fixture/issues-5xxx/5214/1/output/src/foo.bar.baz.js +++ b/crates/swc/tests/fixture/issues-5xxx/5214/1/output/src/foo.bar.baz.js @@ -1 +1 @@ -console.log("exists"); +console.log('exists'); diff --git a/crates/swc/tests/fixture/issues-5xxx/5556/output/index.js b/crates/swc/tests/fixture/issues-5xxx/5556/output/index.js index 2aa981bd3489..9c88da3b670a 100644 --- a/crates/swc/tests/fixture/issues-5xxx/5556/output/index.js +++ b/crates/swc/tests/fixture/issues-5xxx/5556/output/index.js @@ -5,9 +5,9 @@ x = function x1() { var y = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(app) { return { schedule: { - interval: "1m", - type: "all", - disable: app.config.env === "local" + interval: '1m', + type: 'all', + disable: app.config.env === 'local' }, task: function task(ctx) { var res; @@ -16,8 +16,8 @@ x = function x1() { case 0: return [ 4, - ctx.curl("http://www.api.com/cache", { - contentType: "json" + ctx.curl('http://www.api.com/cache', { + contentType: 'json' }) ]; case 1: diff --git a/crates/swc/tests/fixture/issues-6xxx/6418/1/output/input.js b/crates/swc/tests/fixture/issues-6xxx/6418/1/output/input.js index bcaf92431e50..8aa25603cd64 100644 --- a/crates/swc/tests/fixture/issues-6xxx/6418/1/output/input.js +++ b/crates/swc/tests/fixture/issues-6xxx/6418/1/output/input.js @@ -1,2 +1,2 @@ var foo = function o() {}; -console.log("PASS"); +console.log('PASS'); diff --git a/crates/swc/tests/fixture/issues-6xxx/6460/1/output/index.js b/crates/swc/tests/fixture/issues-6xxx/6460/1/output/index.js index 2c8db54a8b52..b085d76a11db 100644 --- a/crates/swc/tests/fixture/issues-6xxx/6460/1/output/index.js +++ b/crates/swc/tests/fixture/issues-6xxx/6460/1/output/index.js @@ -2,7 +2,7 @@ import "core-js/modules/es.array.at.js"; import "core-js/modules/es.regexp.exec.js"; import "core-js/modules/es.string.at-alternative.js"; import "core-js/modules/es.string.split.js"; -"1.2.3".split(".").at(-1); +'1.2.3'.split('.').at(-1); [ 123, 456 diff --git a/crates/swc/tests/fixture/issues-6xxx/6508/1/output/index.js b/crates/swc/tests/fixture/issues-6xxx/6508/1/output/index.js index abd1018de3c9..ae2a248126c0 100644 --- a/crates/swc/tests/fixture/issues-6xxx/6508/1/output/index.js +++ b/crates/swc/tests/fixture/issues-6xxx/6508/1/output/index.js @@ -1,2 +1,2 @@ -"use client"; +'use client'; foo(function() {}); diff --git a/crates/swc/tests/fixture/issues-6xxx/6508/2/output/index.js b/crates/swc/tests/fixture/issues-6xxx/6508/2/output/index.js index a7a9a9c94e48..6c0747920f8a 100644 --- a/crates/swc/tests/fixture/issues-6xxx/6508/2/output/index.js +++ b/crates/swc/tests/fixture/issues-6xxx/6508/2/output/index.js @@ -1,4 +1,4 @@ -"use client"; +'use client'; import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _create_class } from "@swc/helpers/_/_create_class"; export var Foo = /*#__PURE__*/ function() { diff --git a/crates/swc/tests/fixture/issues-6xxx/6508/3/output/index.js b/crates/swc/tests/fixture/issues-6xxx/6508/3/output/index.js index d545b3e9c19a..f4044963fe49 100644 --- a/crates/swc/tests/fixture/issues-6xxx/6508/3/output/index.js +++ b/crates/swc/tests/fixture/issues-6xxx/6508/3/output/index.js @@ -1,4 +1,4 @@ -"use client"; +'use client'; export var Foo = { foo: function foo() {} }; diff --git a/crates/swc/tests/fixture/issues-6xxx/6888/output/index.js b/crates/swc/tests/fixture/issues-6xxx/6888/output/index.js index 317f04e882d8..a1cbcd75e8e0 100644 --- a/crates/swc/tests/fixture/issues-6xxx/6888/output/index.js +++ b/crates/swc/tests/fixture/issues-6xxx/6888/output/index.js @@ -4,8 +4,8 @@ import "core-js/modules/es.string.at-alternative.js"; import "core-js/modules/es.string.replace-all.js"; import "core-js/modules/es.string.replace.js"; import "core-js/modules/es.string.split.js"; -"test".replaceAll("", ""); -"1.2.3".split(".").at(-1); +'test'.replaceAll('', ''); +'1.2.3'.split('.').at(-1); [ 123 ].at(1); diff --git a/crates/swc/tests/fixture/issues-6xxx/6898/output/exec.js b/crates/swc/tests/fixture/issues-6xxx/6898/output/exec.js index e230435e005d..dc8f9afc1355 100644 --- a/crates/swc/tests/fixture/issues-6xxx/6898/output/exec.js +++ b/crates/swc/tests/fixture/issues-6xxx/6898/output/exec.js @@ -6,13 +6,13 @@ _async_to_generator(function() { _loop = function(i) { var value = arr[i]; setTimeout(function() { - console.log("value", value); + console.log('value', value); }, 0); }; arr = [ - "value1", - "value2", - "value3" + 'value1', + 'value2', + 'value3' ]; // for (const value of arr) { for(i = 0; i < arr.length; i++)_loop(i); diff --git a/crates/swc/tests/fixture/issues-6xxx/6984/1/output/index.js b/crates/swc/tests/fixture/issues-6xxx/6984/1/output/index.js index 50640ce7cd01..0603a5046832 100644 --- a/crates/swc/tests/fixture/issues-6xxx/6984/1/output/index.js +++ b/crates/swc/tests/fixture/issues-6xxx/6984/1/output/index.js @@ -3,8 +3,8 @@ import { _ as _create_class } from "@swc/helpers/_/_create_class"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate"; -import React from "react"; -import { withRouter } from "react-router-dom"; +import React from 'react'; +import { withRouter } from 'react-router-dom'; var App = function(_React_Component) { "use strict"; _inherits(App, _React_Component); diff --git a/crates/swc/tests/fixture/issues-7xxx/7240/output/index.js b/crates/swc/tests/fixture/issues-7xxx/7240/output/index.js index 240bd27309fd..66070042e80f 100644 --- a/crates/swc/tests/fixture/issues-7xxx/7240/output/index.js +++ b/crates/swc/tests/fixture/issues-7xxx/7240/output/index.js @@ -8,6 +8,6 @@ Object.defineProperty(exports, "__esModule", { } }); var _obj, _default = ((_obj = { - \u3131: "\u11B0", - \u3141: "\u11B1" -})["\u3142"] = "\u11B2", _obj); + \u3131: '\u11B0', + \u3141: '\u11B1' +})['\u3142'] = '\u11B2', _obj); diff --git a/crates/swc/tests/fixture/issues-7xxx/7253/output/input.js b/crates/swc/tests/fixture/issues-7xxx/7253/output/input.js index afc3fb69ce7f..bb74f5525c06 100644 --- a/crates/swc/tests/fixture/issues-7xxx/7253/output/input.js +++ b/crates/swc/tests/fixture/issues-7xxx/7253/output/input.js @@ -2,4 +2,4 @@ var bmRnd; function a() { bmRnd = function bmRnd1() {}; } -eval(""); +eval(''); diff --git a/crates/swc/tests/fixture/issues-7xxx/7546/output/1.js b/crates/swc/tests/fixture/issues-7xxx/7546/output/1.js index 36a669df842c..8a7f6a367b9c 100644 --- a/crates/swc/tests/fixture/issues-7xxx/7546/output/1.js +++ b/crates/swc/tests/fixture/issues-7xxx/7546/output/1.js @@ -1,5 +1,5 @@ import { _ as _inherits } from "@swc/helpers/_/_inherits"; -import { ClassName } from "./some-file"; +import { ClassName } from './some-file'; export default { field: /*#__PURE__*/ function(ClassName) { "use strict"; diff --git a/crates/swc/tests/fixture/issues-7xxx/7736/case1/output/index.js b/crates/swc/tests/fixture/issues-7xxx/7736/case1/output/index.js index 46ecfe07e538..a599bb6117a0 100644 --- a/crates/swc/tests/fixture/issues-7xxx/7736/case1/output/index.js +++ b/crates/swc/tests/fixture/issues-7xxx/7736/case1/output/index.js @@ -2,16 +2,16 @@ 1, 2 ], [ - "foo", + 'foo', 3 ], [ 4 ], [ - "bar", + 'bar', 5 ], [ [ - "baz", + 'baz', 6 ], 7, diff --git a/crates/swc/tests/fixture/issues-7xxx/7805/output/1.js b/crates/swc/tests/fixture/issues-7xxx/7805/output/1.js index 69e95d33824c..ad81d361c1c8 100644 --- a/crates/swc/tests/fixture/issues-7xxx/7805/output/1.js +++ b/crates/swc/tests/fixture/issues-7xxx/7805/output/1.js @@ -2,28 +2,28 @@ var SUPPORTED_LOCALE = { tr: { regexp: /\u0130|\u0049|\u0049\u0307/g, map: { - \u0130: "i", + \u0130: "\u0069", I: "\u0131", - I\u0307: "i" + I\u0307: "\u0069" } }, az: { regexp: /\u0130/g, map: { - \u0130: "i", + \u0130: "\u0069", I: "\u0131", - I\u0307: "i" + I\u0307: "\u0069" } }, lt: { regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g, map: { - I: "i\u0307", - J: "j\u0307", + I: "\u0069\u0307", + J: "\u006A\u0307", \u012E: "\u012F\u0307", - "\xcc": "i\u0307\u0300", - "\xcd": "i\u0307\u0301", - \u0128: "i\u0307\u0303" + "\xcc": "\u0069\u0307\u0300", + "\xcd": "\u0069\u0307\u0301", + \u0128: "\u0069\u0307\u0303" } } }; diff --git a/crates/swc/tests/fixture/issues-7xxx/7821/output/1.js b/crates/swc/tests/fixture/issues-7xxx/7821/output/1.js index 046ffbdabf55..c189f3216aeb 100644 --- a/crates/swc/tests/fixture/issues-7xxx/7821/output/1.js +++ b/crates/swc/tests/fixture/issues-7xxx/7821/output/1.js @@ -7,7 +7,7 @@ var Blocks = { }, Layout1: function() { return [ - "Block1" + 'Block1' ].map(function(e) { return Blocks[e]; }); diff --git a/crates/swc/tests/fixture/issues-8xxx/8185/output/helper.js b/crates/swc/tests/fixture/issues-8xxx/8185/output/helper.js index a9b602cff48a..3fb2021f93d2 100644 --- a/crates/swc/tests/fixture/issues-8xxx/8185/output/helper.js +++ b/crates/swc/tests/fixture/issues-8xxx/8185/output/helper.js @@ -2,9 +2,9 @@ import { _ as _define_property } from "@swc/helpers/_/_define_property"; var a = function() { var _define_property1 = 1; var fn = function() { - return console.log(_define_property({}, prop, "test")); + return console.log(_define_property({}, prop, 'test')); }; }; var b = function() { - return eval("console.log()"); + return eval('console.log()'); }; diff --git a/crates/swc/tests/fixture/issues-8xxx/8185/output/input.js b/crates/swc/tests/fixture/issues-8xxx/8185/output/input.js index c3830d975dd2..05fae1da72ad 100644 --- a/crates/swc/tests/fixture/issues-8xxx/8185/output/input.js +++ b/crates/swc/tests/fixture/issues-8xxx/8185/output/input.js @@ -1,4 +1,4 @@ (function hello() { - console.log("outer stack", new Error().stack); + console.log('outer stack', new Error().stack); })(); eval(""); diff --git a/crates/swc/tests/fixture/issues-8xxx/8193/output/1.js b/crates/swc/tests/fixture/issues-8xxx/8193/output/1.js index e612626a7d6d..e911a0407a35 100644 --- a/crates/swc/tests/fixture/issues-8xxx/8193/output/1.js +++ b/crates/swc/tests/fixture/issues-8xxx/8193/output/1.js @@ -2,16 +2,16 @@ require("core-js/modules/es.object.create.js"); require("core-js/modules/esnext.object.group-by.js"); var data = [ { - name: "a", - type: "a" + name: 'a', + type: 'a' }, { - name: "b", - type: "a" + name: 'b', + type: 'a' }, { - name: "c", - type: "b" + name: 'c', + type: 'b' } ]; var result = Object.groupBy(data, function(param) { diff --git a/crates/swc/tests/fixture/issues-8xxx/8345/output/1.js b/crates/swc/tests/fixture/issues-8xxx/8345/output/1.js index 37a65bc97cb4..8d703314325b 100644 --- a/crates/swc/tests/fixture/issues-8xxx/8345/output/1.js +++ b/crates/swc/tests/fixture/issues-8xxx/8345/output/1.js @@ -1,2 +1,2 @@ -var data = "\\ud"; +var data = '\\ud'; console.log(data); diff --git a/crates/swc/tests/fixture/issues-8xxx/8435/output/index.js b/crates/swc/tests/fixture/issues-8xxx/8435/output/index.js index c58a5ee49107..57bec1521a27 100644 --- a/crates/swc/tests/fixture/issues-8xxx/8435/output/index.js +++ b/crates/swc/tests/fixture/issues-8xxx/8435/output/index.js @@ -1,6 +1,6 @@ var e; import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _create_class } from "@swc/helpers/_/_create_class"; -(e = window.parcelRequire).register("module1", function() {}), e.register("module2", function() { - console.log("test"); +(e = window.parcelRequire).register('module1', function() {}), e.register('module2', function() { + console.log('test'); }); diff --git a/crates/swc/tests/fixture/issues-8xxx/8482/output/index.js b/crates/swc/tests/fixture/issues-8xxx/8482/output/index.js index d056410bb6cd..e29854d2a9f4 100644 --- a/crates/swc/tests/fixture/issues-8xxx/8482/output/index.js +++ b/crates/swc/tests/fixture/issues-8xxx/8482/output/index.js @@ -15,5 +15,5 @@ return a; } }); - let a = ""; + let a = ''; }); diff --git a/crates/swc/tests/fixture/issues-8xxx/8616/output/1.js b/crates/swc/tests/fixture/issues-8xxx/8616/output/1.js index 40ac5c41be4f..196f0b7f93ee 100644 --- a/crates/swc/tests/fixture/issues-8xxx/8616/output/1.js +++ b/crates/swc/tests/fixture/issues-8xxx/8616/output/1.js @@ -1,6 +1,6 @@ var Module = (function() { - var _scriptDir = typeof document !== "undefined" && document.currentScript ? document.currentScript.src : undefined; - if (typeof __filename !== "undefined") _scriptDir || (_scriptDir = __filename); + var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; + if (typeof __filename !== 'undefined') _scriptDir || (_scriptDir = __filename); return function() { var moduleArg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; var Module = moduleArg; @@ -13,7 +13,7 @@ var Module = (function() { return moduleArg; }; })()(); -if (typeof exports === "object" && typeof module === "object") module.exports = Module; -else if (typeof define === "function" && define["amd"]) define([], function() { +if (typeof exports === 'object' && typeof module === 'object') module.exports = Module; +else if (typeof define === 'function' && define['amd']) define([], function() { return Module; }); diff --git a/crates/swc/tests/fixture/issues-8xxx/8701/1/output/src/app.controller.spec.ts b/crates/swc/tests/fixture/issues-8xxx/8701/1/output/src/app.controller.spec.ts index acfd162f01a3..0691c3a3f6eb 100644 --- a/crates/swc/tests/fixture/issues-8xxx/8701/1/output/src/app.controller.spec.ts +++ b/crates/swc/tests/fixture/issues-8xxx/8701/1/output/src/app.controller.spec.ts @@ -3,7 +3,7 @@ import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator"; import { Test } from "@nestjs/testing"; import { AppController } from "./app.controller"; import { AppService } from "./app.service"; -describe("AppController", function() { +describe('AppController', function() { var app; beforeAll(/*#__PURE__*/ _async_to_generator(function() { return _ts_generator(this, function(_state) { @@ -28,10 +28,10 @@ describe("AppController", function() { } }); })); - describe("getHello", function() { + describe('getHello', function() { it('should return "Hello World!"', function() { var appController = app.get(AppController); - expect(appController.getHello()).toBe("Hello World!"); + expect(appController.getHello()).toBe('Hello World!'); }); }); }); diff --git a/crates/swc/tests/fixture/issues-8xxx/8701/1/output/src/app.service.ts b/crates/swc/tests/fixture/issues-8xxx/8701/1/output/src/app.service.ts index 7997c7a93d63..a64f8f74bda9 100644 --- a/crates/swc/tests/fixture/issues-8xxx/8701/1/output/src/app.service.ts +++ b/crates/swc/tests/fixture/issues-8xxx/8701/1/output/src/app.service.ts @@ -11,7 +11,7 @@ export var AppService = /*#__PURE__*/ function() { { key: "getHello", value: function getHello() { - return "Hello World!"; + return 'Hello World!'; } } ]); diff --git a/crates/swc/tests/fixture/issues-8xxx/8863/input/.swcrc b/crates/swc/tests/fixture/issues-8xxx/8863/input/.swcrc new file mode 100644 index 000000000000..887e89d7affc --- /dev/null +++ b/crates/swc/tests/fixture/issues-8xxx/8863/input/.swcrc @@ -0,0 +1,19 @@ +{ + "jsc": { + "parser": { + "syntax": "typescript", + "tsx": false + }, + "target": "es5", + "loose": false, + "minify": { + "compress": false, + "mangle": false + } + }, + "module": { + "type": "es6" + }, + "minify": false, + "isModule": true +} \ No newline at end of file diff --git a/crates/swc/tests/fixture/issues-8xxx/8863/input/1.js b/crates/swc/tests/fixture/issues-8xxx/8863/input/1.js new file mode 100644 index 000000000000..49b07e1bfad3 --- /dev/null +++ b/crates/swc/tests/fixture/issues-8xxx/8863/input/1.js @@ -0,0 +1 @@ +`pattern="\x5cd"`; \ No newline at end of file diff --git a/crates/swc/tests/fixture/issues-8xxx/8863/output/1.js b/crates/swc/tests/fixture/issues-8xxx/8863/output/1.js new file mode 100644 index 000000000000..4fb081f0ac4b --- /dev/null +++ b/crates/swc/tests/fixture/issues-8xxx/8863/output/1.js @@ -0,0 +1 @@ +'pattern="\\d"'; diff --git a/crates/swc/tests/fixture/issues-8xxx/8871/input/.swcrc b/crates/swc/tests/fixture/issues-8xxx/8871/input/.swcrc new file mode 100644 index 000000000000..9c6bc311ad06 --- /dev/null +++ b/crates/swc/tests/fixture/issues-8xxx/8871/input/.swcrc @@ -0,0 +1,25 @@ +{ + "jsc": { + "parser": { + "syntax": "ecmascript", + "jsx": false + }, + "loose": true, + "minify": { + "compress": false, + "mangle": false + }, + "transform": { + "react": { + "runtime": "classic", + "development": false + } + }, + "target": "es5" + }, + "module": { + "type": "es6" + }, + "minify": false, + "isModule": true +} \ No newline at end of file diff --git a/crates/swc/tests/fixture/issues-8xxx/8871/input/1.js b/crates/swc/tests/fixture/issues-8xxx/8871/input/1.js new file mode 100644 index 000000000000..a6313d6e9820 --- /dev/null +++ b/crates/swc/tests/fixture/issues-8xxx/8871/input/1.js @@ -0,0 +1,5 @@ +const x = "" +const y = "<\/script>" +const z = "\/\/ \\" + +export { x, y, z } \ No newline at end of file diff --git a/crates/swc/tests/fixture/issues-8xxx/8871/output/1.js b/crates/swc/tests/fixture/issues-8xxx/8871/output/1.js new file mode 100644 index 000000000000..8b13a6238ebf --- /dev/null +++ b/crates/swc/tests/fixture/issues-8xxx/8871/output/1.js @@ -0,0 +1,4 @@ +var x = ""; +var y = "<\/script>"; +var z = "\/\/ \\"; +export { x, y, z }; diff --git a/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/users.controller.spec.ts b/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/users.controller.spec.ts index 03e3d1b39a57..8d97589c5a74 100644 --- a/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/users.controller.spec.ts +++ b/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/users.controller.spec.ts @@ -3,7 +3,7 @@ import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator"; import { Test } from "@nestjs/testing"; import { UsersController } from "./users.controller"; import { UsersService } from "./users.service"; -describe("UsersController", function() { +describe('UsersController', function() { var controller; beforeEach(/*#__PURE__*/ _async_to_generator(function() { var module; @@ -30,7 +30,7 @@ describe("UsersController", function() { } }); })); - it("should be defined", function() { + it('should be defined', function() { expect(controller).toBeDefined(); }); }); diff --git a/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/users.controller.ts b/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/users.controller.ts index 2089e981a46e..6f389224f4a2 100644 --- a/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/users.controller.ts +++ b/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/users.controller.ts @@ -53,18 +53,18 @@ _ts_decorate([ Get() ], UsersController.prototype, "findAll", null); _ts_decorate([ - Get(":id"), - _ts_param(0, Param("id")) + Get(':id'), + _ts_param(0, Param('id')) ], UsersController.prototype, "findOne", null); _ts_decorate([ - Patch(":id"), - _ts_param(0, Param("id")), + Patch(':id'), + _ts_param(0, Param('id')), _ts_param(1, Body()) ], UsersController.prototype, "update", null); _ts_decorate([ - Delete(":id"), - _ts_param(0, Param("id")) + Delete(':id'), + _ts_param(0, Param('id')) ], UsersController.prototype, "remove", null); UsersController = _ts_decorate([ - Controller("users") + Controller('users') ], UsersController); diff --git a/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/users.service.spec.ts b/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/users.service.spec.ts index bec7a4dfdf18..fbb96647ac95 100644 --- a/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/users.service.spec.ts +++ b/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/users.service.spec.ts @@ -2,7 +2,7 @@ import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator"; import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator"; import { Test } from "@nestjs/testing"; import { UsersService } from "./users.service"; -describe("UsersService", function() { +describe('UsersService', function() { var service; beforeEach(/*#__PURE__*/ _async_to_generator(function() { var module; @@ -26,7 +26,7 @@ describe("UsersService", function() { } }); })); - it("should be defined", function() { + it('should be defined', function() { expect(service).toBeDefined(); }); }); diff --git a/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/users.service.ts b/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/users.service.ts index 3611a4103291..f438bd988c56 100644 --- a/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/users.service.ts +++ b/crates/swc/tests/fixture/jsc-paths/7603/1/output/src/users/users.service.ts @@ -11,7 +11,7 @@ export var UsersService = /*#__PURE__*/ function() { { key: "create", value: function create(createUserDto) { - return "This action adds a new user"; + return 'This action adds a new user'; } }, { diff --git a/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/users.controller.spec.ts b/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/users.controller.spec.ts index 03e3d1b39a57..8d97589c5a74 100644 --- a/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/users.controller.spec.ts +++ b/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/users.controller.spec.ts @@ -3,7 +3,7 @@ import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator"; import { Test } from "@nestjs/testing"; import { UsersController } from "./users.controller"; import { UsersService } from "./users.service"; -describe("UsersController", function() { +describe('UsersController', function() { var controller; beforeEach(/*#__PURE__*/ _async_to_generator(function() { var module; @@ -30,7 +30,7 @@ describe("UsersController", function() { } }); })); - it("should be defined", function() { + it('should be defined', function() { expect(controller).toBeDefined(); }); }); diff --git a/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/users.controller.ts b/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/users.controller.ts index 2089e981a46e..6f389224f4a2 100644 --- a/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/users.controller.ts +++ b/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/users.controller.ts @@ -53,18 +53,18 @@ _ts_decorate([ Get() ], UsersController.prototype, "findAll", null); _ts_decorate([ - Get(":id"), - _ts_param(0, Param("id")) + Get(':id'), + _ts_param(0, Param('id')) ], UsersController.prototype, "findOne", null); _ts_decorate([ - Patch(":id"), - _ts_param(0, Param("id")), + Patch(':id'), + _ts_param(0, Param('id')), _ts_param(1, Body()) ], UsersController.prototype, "update", null); _ts_decorate([ - Delete(":id"), - _ts_param(0, Param("id")) + Delete(':id'), + _ts_param(0, Param('id')) ], UsersController.prototype, "remove", null); UsersController = _ts_decorate([ - Controller("users") + Controller('users') ], UsersController); diff --git a/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/users.service.spec.ts b/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/users.service.spec.ts index bec7a4dfdf18..fbb96647ac95 100644 --- a/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/users.service.spec.ts +++ b/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/users.service.spec.ts @@ -2,7 +2,7 @@ import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator"; import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator"; import { Test } from "@nestjs/testing"; import { UsersService } from "./users.service"; -describe("UsersService", function() { +describe('UsersService', function() { var service; beforeEach(/*#__PURE__*/ _async_to_generator(function() { var module; @@ -26,7 +26,7 @@ describe("UsersService", function() { } }); })); - it("should be defined", function() { + it('should be defined', function() { expect(service).toBeDefined(); }); }); diff --git a/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/users.service.ts b/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/users.service.ts index 3611a4103291..f438bd988c56 100644 --- a/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/users.service.ts +++ b/crates/swc/tests/fixture/jsc-paths/7603/2/output/src/users/users.service.ts @@ -11,7 +11,7 @@ export var UsersService = /*#__PURE__*/ function() { { key: "create", value: function create(createUserDto) { - return "This action adds a new user"; + return 'This action adds a new user'; } }, { diff --git a/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/identity.ts b/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/identity.ts index 1f770ebdfc64..745befd2bae9 100644 --- a/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/identity.ts +++ b/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/identity.ts @@ -1,9 +1,9 @@ import { nanoid } from "nanoid"; import { fnv1a } from "../fnv1a"; -export var VERCEL_AUTHENTICATED_PREFIX = "v_"; +export var VERCEL_AUTHENTICATED_PREFIX = 'v_'; /** * 1.0 -- random IDs from nanoid() with default length. Authenticated IDs are v_vercelUserID. - */ export var IDENTITY_VERSION = "1.0"; + */ export var IDENTITY_VERSION = '1.0'; export function generateRandomID() { return nanoid(); } diff --git a/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/async/index.browser.js b/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/async/index.browser.js index 252ccad11291..0add4f1f3f1a 100644 --- a/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/async/index.browser.js +++ b/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/async/index.browser.js @@ -22,12 +22,12 @@ export var customAlphabet = function(alphabet) { var _arguments = arguments; return _ts_generator(this, function(_state) { size = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : defaultSize; - id = ""; + id = ''; while(true){ bytes = crypto.getRandomValues(new Uint8Array(step)); i = step; while(i--){ - id += alphabet[bytes[i] & mask] || ""; + id += alphabet[bytes[i] & mask] || ''; if (id.length === size) return [ 2, id @@ -46,7 +46,7 @@ export var nanoid = function() { var _arguments = arguments; return _ts_generator(this, function(_state) { size = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : 21; - id = ""; + id = ''; bytes = crypto.getRandomValues(new Uint8Array(size)); while(size--){ byte = bytes[size] & 63; @@ -55,9 +55,9 @@ export var nanoid = function() { } else if (byte < 62) { id += (byte - 26).toString(36).toUpperCase(); } else if (byte < 63) { - id += "_"; + id += '_'; } else { - id += "-"; + id += '-'; } } return [ diff --git a/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/async/index.js b/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/async/index.js index 13bf36c80005..b6fda413df16 100644 --- a/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/async/index.js +++ b/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/async/index.js @@ -20,20 +20,20 @@ export var customAlphabet = function(alphabet) { return random(step).then(function(bytes) { var i = step; while(i--){ - id += alphabet[bytes[i] & mask] || ""; + id += alphabet[bytes[i] & mask] || ''; if (id.length === size) return id; } return tick(id, size); }); }; return function(size) { - return tick("", size); + return tick('', size); }; }; export var nanoid = function() { var size = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 21; return random(size).then(function(bytes) { - var id = ""; + var id = ''; while(size--){ id += urlAlphabet[bytes[size] & 63]; } diff --git a/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/async/index.native.js b/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/async/index.native.js index 1aeed747140c..bd8f89fb5838 100644 --- a/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/async/index.native.js +++ b/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/async/index.native.js @@ -10,20 +10,20 @@ export var customAlphabet = function(alphabet) { return random(step).then(function(bytes) { var i = step; while(i--){ - id += alphabet[bytes[i] & mask] || ""; + id += alphabet[bytes[i] & mask] || ''; if (id.length === size) return id; } return tick(id, size); }); }; return function(size) { - return tick("", size); + return tick('', size); }; }; export var nanoid = function() { var size = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 21; return random(size).then(function(bytes) { - var id = ""; + var id = ''; while(size--){ id += urlAlphabet[bytes[size] & 63]; } diff --git a/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/bin/nanoid.js b/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/bin/nanoid.js index 942ee33a4968..4ea041308060 100644 --- a/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/bin/nanoid.js +++ b/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/bin/nanoid.js @@ -1,30 +1,30 @@ #!/usr/bin/env node import { nanoid, customAlphabet } from "../index.js"; function print(msg) { - process.stdout.write(msg + "\n"); + process.stdout.write(msg + '\n'); } function error(msg) { - process.stderr.write(msg + "\n"); + process.stderr.write(msg + '\n'); process.exit(1); } -if (process.argv.includes("--help") || process.argv.includes("-h")) { +if (process.argv.includes('--help') || process.argv.includes('-h')) { print("\n Usage\n $ nanoid [options]\n Options\n -s, --size Generated ID size\n -a, --alphabet Alphabet to use\n -h, --help Show this help\n Examples\n $ nanoid --s 15\n S9sBF77U6sDB8Yg\n $ nanoid --size 10 --alphabet abc\n bcabababca"); process.exit(); } var alphabet, size; for(var i = 2; i < process.argv.length; i++){ var arg = process.argv[i]; - if (arg === "--size" || arg === "-s") { + if (arg === '--size' || arg === '-s') { size = Number(process.argv[i + 1]); i += 1; if (Number.isNaN(size) || size <= 0) { - error("Size must be positive integer"); + error('Size must be positive integer'); } - } else if (arg === "--alphabet" || arg === "-a") { + } else if (arg === '--alphabet' || arg === '-a') { alphabet = process.argv[i + 1]; i += 1; } else { - error("Unknown argument " + arg); + error('Unknown argument ' + arg); } } if (alphabet) { diff --git a/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/index.browser.js b/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/index.browser.js index 614578ca018a..a23e4c533cd9 100644 --- a/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/index.browser.js +++ b/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/index.browser.js @@ -7,12 +7,12 @@ export var customRandom = function(alphabet, defaultSize, getRandom) { var step = -~(1.6 * mask * defaultSize / alphabet.length); return function() { var size = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : defaultSize; - var id = ""; + var id = ''; while(true){ var bytes = getRandom(step); var j = step; while(j--){ - id += alphabet[bytes[j] & mask] || ""; + id += alphabet[bytes[j] & mask] || ''; if (id.length === size) return id; } } @@ -31,10 +31,10 @@ export var nanoid = function() { } else if (byte < 62) { id += (byte - 26).toString(36).toUpperCase(); } else if (byte > 62) { - id += "-"; + id += '-'; } else { - id += "_"; + id += '_'; } return id; - }, ""); + }, ''); }; diff --git a/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/index.js b/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/index.js index 1d010af0a725..df8b7d8be5c1 100644 --- a/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/index.js +++ b/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/index.js @@ -23,12 +23,12 @@ export var customRandom = function(alphabet, defaultSize, getRandom) { var step = Math.ceil(1.6 * mask * defaultSize / alphabet.length); return function() { var size = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : defaultSize; - var id = ""; + var id = ''; while(true){ var bytes = getRandom(step); var i = step; while(i--){ - id += alphabet[bytes[i] & mask] || ""; + id += alphabet[bytes[i] & mask] || ''; if (id.length === size) return id; } } @@ -41,7 +41,7 @@ export var customAlphabet = function(alphabet) { export var nanoid = function() { var size = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 21; fillPool(size -= 0); - var id = ""; + var id = ''; for(var i = poolOffset - size; i < poolOffset; i++){ id += urlAlphabet[pool[i] & 63]; } diff --git a/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/non-secure/index.js b/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/non-secure/index.js index b1ef543f3fd7..cd82aacd7dcf 100644 --- a/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/non-secure/index.js +++ b/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/non-secure/index.js @@ -1,9 +1,9 @@ -var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"; +var urlAlphabet = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'; export var customAlphabet = function(alphabet) { var defaultSize = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 21; return function() { var size = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : defaultSize; - var id = ""; + var id = ''; var i = size; while(i--){ id += alphabet[Math.random() * alphabet.length | 0]; @@ -13,7 +13,7 @@ export var customAlphabet = function(alphabet) { }; export var nanoid = function() { var size = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 21; - var id = ""; + var id = ''; var i = size; while(i--){ id += urlAlphabet[Math.random() * 64 | 0]; diff --git a/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/url-alphabet/index.js b/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/url-alphabet/index.js index f3f0cda11c03..1b2d3c6a8571 100644 --- a/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/url-alphabet/index.js +++ b/crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/node_modules/.pnpm/nanoid@4.0.2/node_modules/nanoid/url-alphabet/index.js @@ -1 +1 @@ -export var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"; +export var urlAlphabet = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'; diff --git a/crates/swc/tests/fixture/next.js/octal/1/output/1.js b/crates/swc/tests/fixture/next.js/octal/1/output/1.js index b18d36fec5ac..9ce04ab5cc4c 100644 --- a/crates/swc/tests/fixture/next.js/octal/1/output/1.js +++ b/crates/swc/tests/fixture/next.js/octal/1/output/1.js @@ -1 +1 @@ -export var shouldNotBeOctal = "\x001"; +export var shouldNotBeOctal = '\x001'; diff --git a/crates/swc/tests/projects/issue-226/input.js b/crates/swc/tests/projects/issue-226/input.js index 5ad56155ba54..c840fb16906e 100644 --- a/crates/swc/tests/projects/issue-226/input.js +++ b/crates/swc/tests/projects/issue-226/input.js @@ -1 +1 @@ -export * as Foo from 'bar'; \ No newline at end of file +export * as Foo from "bar"; \ No newline at end of file diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.1.normal.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.1.normal.js index 681a6f0a2b8d..bc23d8804be1 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.1.normal.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.1.normal.js @@ -12,7 +12,7 @@ var clodule = /*#__PURE__*/ function() { }(); (function(clodule) { function fn(x, y) { - return clodule.sfn("a"); + return clodule.sfn('a'); } // error: duplicate identifier expected clodule.fn = fn; diff --git a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.2.minified.js b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.2.minified.js index d4389a540799..7f211461b1b7 100644 --- a/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.2.minified.js +++ b/crates/swc/tests/tsc-references/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.2.minified.js @@ -9,5 +9,5 @@ var clodule, clodule1 = function() { }, clodule; }(); (clodule = clodule1 || (clodule1 = {})).fn = function(x, y) { - return clodule.sfn("a"); + return clodule.sfn('a'); }; diff --git a/crates/swc/tests/tsc-references/ES5For-of1.1.normal.js b/crates/swc/tests/tsc-references/ES5For-of1.1.normal.js index 13a1a201fd81..0edcbc74213f 100644 --- a/crates/swc/tests/tsc-references/ES5For-of1.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-of1.1.normal.js @@ -1,8 +1,8 @@ //// [ES5For-of1.ts] for(var _i = 0, _iter = [ - "a", - "b", - "c" + 'a', + 'b', + 'c' ]; _i < _iter.length; _i++){ var v = _iter[_i]; console.log(v); diff --git a/crates/swc/tests/tsc-references/ES5For-of1.2.minified.js b/crates/swc/tests/tsc-references/ES5For-of1.2.minified.js index 82e267a09674..2d6bc1f159a8 100644 --- a/crates/swc/tests/tsc-references/ES5For-of1.2.minified.js +++ b/crates/swc/tests/tsc-references/ES5For-of1.2.minified.js @@ -1,6 +1,6 @@ //// [ES5For-of1.ts] for(var _i = 0, _iter = [ - "a", - "b", - "c" + 'a', + 'b', + 'c' ]; _i < _iter.length; _i++)console.log(_iter[_i]); diff --git a/crates/swc/tests/tsc-references/ES5For-of13.1.normal.js b/crates/swc/tests/tsc-references/ES5For-of13.1.normal.js index ed6d0de4f125..2f16be7bb8e5 100644 --- a/crates/swc/tests/tsc-references/ES5For-of13.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-of13.1.normal.js @@ -1,8 +1,8 @@ //// [ES5For-of13.ts] for(var _i = 0, _iter = [ - "a", - "b", - "c" + 'a', + 'b', + 'c' ]; _i < _iter.length; _i++){ var v = _iter[_i]; var x = v; diff --git a/crates/swc/tests/tsc-references/ES5For-of13.2.minified.js b/crates/swc/tests/tsc-references/ES5For-of13.2.minified.js index b22a4405a966..2f82fecf39a2 100644 --- a/crates/swc/tests/tsc-references/ES5For-of13.2.minified.js +++ b/crates/swc/tests/tsc-references/ES5For-of13.2.minified.js @@ -1,6 +1,6 @@ //// [ES5For-of13.ts] for(var _i = 0, _iter = [ - "a", - "b", - "c" + 'a', + 'b', + 'c' ]; _i < _iter.length; _i++)_iter[_i]; diff --git a/crates/swc/tests/tsc-references/ES5For-of3.1.normal.js b/crates/swc/tests/tsc-references/ES5For-of3.1.normal.js index 07e9a612cd4f..4dbb39075d66 100644 --- a/crates/swc/tests/tsc-references/ES5For-of3.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-of3.1.normal.js @@ -1,8 +1,8 @@ //// [ES5For-of3.ts] for(var _i = 0, _iter = [ - "a", - "b", - "c" + 'a', + 'b', + 'c' ]; _i < _iter.length; _i++){ var v = _iter[_i]; var x = v; diff --git a/crates/swc/tests/tsc-references/ES5For-of3.2.minified.js b/crates/swc/tests/tsc-references/ES5For-of3.2.minified.js index 06c6d3ac5d59..68deb84076cb 100644 --- a/crates/swc/tests/tsc-references/ES5For-of3.2.minified.js +++ b/crates/swc/tests/tsc-references/ES5For-of3.2.minified.js @@ -1,6 +1,6 @@ //// [ES5For-of3.ts] for(var _i = 0, _iter = [ - "a", - "b", - "c" + 'a', + 'b', + 'c' ]; _i < _iter.length; _i++)_iter[_i]; diff --git a/crates/swc/tests/tsc-references/ES5For-of33.1.normal.js b/crates/swc/tests/tsc-references/ES5For-of33.1.normal.js index 1f4906c2c988..beae6bb4ea7b 100644 --- a/crates/swc/tests/tsc-references/ES5For-of33.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-of33.1.normal.js @@ -1,8 +1,8 @@ //// [ES5For-of33.ts] for(var _i = 0, _iter = [ - "a", - "b", - "c" + 'a', + 'b', + 'c' ]; _i < _iter.length; _i++){ var v = _iter[_i]; console.log(v); diff --git a/crates/swc/tests/tsc-references/ES5For-of33.2.minified.js b/crates/swc/tests/tsc-references/ES5For-of33.2.minified.js index f85c474517df..6183e80734dc 100644 --- a/crates/swc/tests/tsc-references/ES5For-of33.2.minified.js +++ b/crates/swc/tests/tsc-references/ES5For-of33.2.minified.js @@ -1,6 +1,6 @@ //// [ES5For-of33.ts] for(var _i = 0, _iter = [ - "a", - "b", - "c" + 'a', + 'b', + 'c' ]; _i < _iter.length; _i++)console.log(_iter[_i]); diff --git a/crates/swc/tests/tsc-references/ES5For-of34.1.normal.js b/crates/swc/tests/tsc-references/ES5For-of34.1.normal.js index d41709bd4de9..1fa9ae3ebf38 100644 --- a/crates/swc/tests/tsc-references/ES5For-of34.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-of34.1.normal.js @@ -5,9 +5,9 @@ function foo() { }; } for(var _i = 0, _iter = [ - "a", - "b", - "c" + 'a', + 'b', + 'c' ]; _i < _iter.length; _i++){ foo().x = _iter[_i]; var p = foo().x; diff --git a/crates/swc/tests/tsc-references/ES5For-of34.2.minified.js b/crates/swc/tests/tsc-references/ES5For-of34.2.minified.js index 7a9cdc940674..e40a6a897797 100644 --- a/crates/swc/tests/tsc-references/ES5For-of34.2.minified.js +++ b/crates/swc/tests/tsc-references/ES5For-of34.2.minified.js @@ -1,6 +1,6 @@ //// [ES5For-of34.ts] for(var _i = 0, _iter = [ - "a", - "b", - "c" + 'a', + 'b', + 'c' ]; _i < _iter.length; _i++)_iter[_i]; diff --git a/crates/swc/tests/tsc-references/ES5For-of37.1.normal.js b/crates/swc/tests/tsc-references/ES5For-of37.1.normal.js index f1982864c6d1..d28315106cc3 100644 --- a/crates/swc/tests/tsc-references/ES5For-of37.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-of37.1.normal.js @@ -17,11 +17,11 @@ for(var _i = 0, _iter = [ ]; _i1 < _iter1.length; _i1++){ var j = _iter1[_i1]; if (i === 2) { - throw new Error("ERR"); + throw new Error('ERR'); } } console.log(i); } catch (err) { - console.log("E %s %s", i, err); + console.log('E %s %s', i, err); } } diff --git a/crates/swc/tests/tsc-references/ES5For-of37.2.minified.js b/crates/swc/tests/tsc-references/ES5For-of37.2.minified.js index 52f0fa6314b6..189ad66002c7 100644 --- a/crates/swc/tests/tsc-references/ES5For-of37.2.minified.js +++ b/crates/swc/tests/tsc-references/ES5For-of37.2.minified.js @@ -12,9 +12,9 @@ for(var _i = 0, _iter = [ 1, 2, 3 - ]; _i1 < _iter1.length; _i1++)if (_iter1[_i1], 2 === i) throw Error("ERR"); + ]; _i1 < _iter1.length; _i1++)if (_iter1[_i1], 2 === i) throw Error('ERR'); console.log(i); } catch (err) { - console.log("E %s %s", i, err); + console.log('E %s %s', i, err); } } diff --git a/crates/swc/tests/tsc-references/ES5For-of8.1.normal.js b/crates/swc/tests/tsc-references/ES5For-of8.1.normal.js index 305d392570c8..311a6c8f43ad 100644 --- a/crates/swc/tests/tsc-references/ES5For-of8.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-of8.1.normal.js @@ -5,9 +5,9 @@ function foo() { }; } for(var _i = 0, _iter = [ - "a", - "b", - "c" + 'a', + 'b', + 'c' ]; _i < _iter.length; _i++){ foo().x = _iter[_i]; var p = foo().x; diff --git a/crates/swc/tests/tsc-references/ES5For-of8.2.minified.js b/crates/swc/tests/tsc-references/ES5For-of8.2.minified.js index 0f1af2f26ad2..9f3f2c8c7b60 100644 --- a/crates/swc/tests/tsc-references/ES5For-of8.2.minified.js +++ b/crates/swc/tests/tsc-references/ES5For-of8.2.minified.js @@ -1,6 +1,6 @@ //// [ES5For-of8.ts] for(var _i = 0, _iter = [ - "a", - "b", - "c" + 'a', + 'b', + 'c' ]; _i < _iter.length; _i++)_iter[_i]; diff --git a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck13.1.normal.js b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck13.1.normal.js index 16516dfc0318..9ae113dec457 100644 --- a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck13.1.normal.js +++ b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck13.1.normal.js @@ -1,7 +1,7 @@ //// [ES5For-ofTypeCheck13.ts] var strSet = new Set(); -strSet.add("Hello"); -strSet.add("World"); +strSet.add('Hello'); +strSet.add('World'); var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { for(var _iterator = strSet[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ diff --git a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck13.2.minified.js b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck13.2.minified.js index 70b130de9277..c571177d3132 100644 --- a/crates/swc/tests/tsc-references/ES5For-ofTypeCheck13.2.minified.js +++ b/crates/swc/tests/tsc-references/ES5For-ofTypeCheck13.2.minified.js @@ -1,6 +1,6 @@ //// [ES5For-ofTypeCheck13.ts] var strSet = new Set(); -strSet.add("Hello"), strSet.add("World"); +strSet.add('Hello'), strSet.add('World'); var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0; try { for(var _step, _iterator = strSet[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0)_step.value; diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables.1.normal.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables.1.normal.js index f3d6c93a6d5e..d2b8d3b97fa5 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables.1.normal.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables.1.normal.js @@ -1,7 +1,7 @@ //// [ModuleWithExportedAndNonExportedVariables.ts] var A; (function(A) { - A.x = "hello world"; + A.x = 'hello world'; var y = 12; })(A || (A = {})); var x; diff --git a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables.2.minified.js b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables.2.minified.js index 49a4c717e318..2e53de418e59 100644 --- a/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables.2.minified.js +++ b/crates/swc/tests/tsc-references/ModuleWithExportedAndNonExportedVariables.2.minified.js @@ -1,3 +1,3 @@ //// [ModuleWithExportedAndNonExportedVariables.ts] var A; -(A || (A = {})).x = "hello world", A.x, A.y; +(A || (A = {})).x = 'hello world', A.x, A.y; diff --git a/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped.1.normal.js b/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped.1.normal.js index ebbe9fb78f2f..e82ba23bb21c 100644 --- a/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped.1.normal.js +++ b/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped.1.normal.js @@ -21,4 +21,4 @@ var C = /*#__PURE__*/ function() { return C; }(); var c; -var r = c.x(""); // string +var r = c.x(''); // string diff --git a/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped.2.minified.js b/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped.2.minified.js index 876e747c2a2b..a398b06662e8 100644 --- a/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped.2.minified.js +++ b/crates/swc/tests/tsc-references/accessorsAreNotContextuallyTyped.2.minified.js @@ -2,4 +2,4 @@ var c; import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _create_class } from "@swc/helpers/_/_create_class"; -c.x(""); +c.x(''); diff --git a/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType.1.normal.js index 7b50025333a9..6daf53e7f407 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithAnyAndEveryType.1.normal.js @@ -41,10 +41,10 @@ var r13 = a + new C(); var r14 = a + E; var r15 = a + 0; var r16 = a + M; -var r17 = a + ""; +var r17 = a + ''; var r18 = a + 123; var r19 = a + { - a: "" + a: '' }; var r20 = a + function(a) { return a; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndInvalidOperator.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndInvalidOperator.1.normal.js index ce81e69f7f38..c9b079e2ae0c 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndInvalidOperator.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndInvalidOperator.1.normal.js @@ -18,7 +18,7 @@ var r6 = null + c; var r7 = null + d; var r8 = null + true; var r9 = null + { - a: "" + a: '' }; var r10 = null + foo(); var r11 = null + function() {}; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator.1.normal.js index 9e312abf9115..fd118fe459eb 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithNullValueAndValidOperator.1.normal.js @@ -26,6 +26,6 @@ var r11 = 0 + null; var r12 = 0 + null; // null + string var r13 = null + d; -var r14 = null + ""; +var r14 = null + ''; var r15 = d + null; -var r16 = "" + null; +var r16 = '' + null; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType.1.normal.js index af565770a717..03d30688cd0b 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithStringAndEveryType.1.normal.js @@ -33,9 +33,9 @@ var r14 = g + x; // other cases var r15 = x + E; var r16 = x + 0; -var r17 = x + ""; +var r17 = x + ''; var r18 = x + 0; var r19 = x + { - a: "" + a: '' }; var r20 = x + []; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndInvalidOperands.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndInvalidOperands.1.normal.js index 557bbd5d2a4f..fe16493a7e2e 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndInvalidOperands.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndInvalidOperands.1.normal.js @@ -18,7 +18,7 @@ var r6 = undefined + c; var r7 = undefined + d; var r8 = undefined + true; var r9 = undefined + { - a: "" + a: '' }; var r10 = undefined + foo(); var r11 = undefined + function() {}; diff --git a/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator.1.normal.js b/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator.1.normal.js index d3cd3221e814..054d6952afac 100644 --- a/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator.1.normal.js +++ b/crates/swc/tests/tsc-references/additionOperatorWithUndefinedValueAndValidOperator.1.normal.js @@ -26,6 +26,6 @@ var r11 = 0 + undefined; var r12 = 0 + undefined; // undefined + string var r13 = undefined + d; -var r14 = undefined + ""; +var r14 = undefined + ''; var r15 = d + undefined; -var r16 = "" + undefined; +var r16 = '' + undefined; diff --git a/crates/swc/tests/tsc-references/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.1.normal.js b/crates/swc/tests/tsc-references/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.1.normal.js index 19249d5e6534..a526a4a2ca1b 100644 --- a/crates/swc/tests/tsc-references/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.1.normal.js +++ b/crates/swc/tests/tsc-references/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.1.normal.js @@ -1,18 +1,18 @@ //// [allowUnescapedParagraphAndLineSeparatorsInStringLiteral.ts] // Strings containing unescaped line / paragraph separators // Using both single quotes, double quotes and template literals -var stringContainingUnescapedLineSeparator1 = "\u2028STRING_CONTENT\u2028"; -var stringContainingUnescapedParagraphSeparator1 = "\u2029STRING_CONTENT\u2029"; -var stringContainingUnescapedLineSeparator2 = "\u2028STRING_CONTENT\u2028"; -var stringContainingUnescapedParagraphSeparator2 = "\u2029STRING_CONTENT\u2029"; +var stringContainingUnescapedLineSeparator1 = "
STRING_CONTENT
"; +var stringContainingUnescapedParagraphSeparator1 = "
STRING_CONTENT
"; +var stringContainingUnescapedLineSeparator2 = '
STRING_CONTENT
'; +var stringContainingUnescapedParagraphSeparator2 = '
STRING_CONTENT
'; var stringContainingUnescapedLineSeparator3 = "\u2028STRING_CONTENT\u2028"; var stringContainingUnescapedParagraphSeparator3 = "\u2029STRING_CONTENT\u2029"; // Array of unescaped line / paragraph separators var arr = [ - "\u2029\u2028STRING_CONTENT\u2028\u2029", - "\u2028\u2029\u2029STRING_CONTENT\u2029\u2029\u2028", - "STRING_CONTENT\u2029", - "\u2028STRING_CONTENT", + "

STRING_CONTENT

", + "


STRING_CONTENT


", + "STRING_CONTENT
", + "
STRING_CONTENT", "", - "\u2028" + '
' ]; diff --git a/crates/swc/tests/tsc-references/anyAsConstructor.1.normal.js b/crates/swc/tests/tsc-references/anyAsConstructor.1.normal.js index cd4e86d5c29b..87ab7e787401 100644 --- a/crates/swc/tests/tsc-references/anyAsConstructor.1.normal.js +++ b/crates/swc/tests/tsc-references/anyAsConstructor.1.normal.js @@ -3,7 +3,7 @@ // can be called except with type arguments which is an error var x; var a = new x(); -var b = new x("hello"); +var b = new x('hello'); var c = new x(x); // grammar allows this for constructors var d = new x(x); // no error diff --git a/crates/swc/tests/tsc-references/anyAsConstructor.2.minified.js b/crates/swc/tests/tsc-references/anyAsConstructor.2.minified.js index 841522ae1313..2aadfe5978cc 100644 --- a/crates/swc/tests/tsc-references/anyAsConstructor.2.minified.js +++ b/crates/swc/tests/tsc-references/anyAsConstructor.2.minified.js @@ -1,3 +1,3 @@ //// [anyAsConstructor.ts] var x; -new x(), new x("hello"), new x(x), new x(x); +new x(), new x('hello'), new x(x), new x(x); diff --git a/crates/swc/tests/tsc-references/anyAsFunctionCall.1.normal.js b/crates/swc/tests/tsc-references/anyAsFunctionCall.1.normal.js index 5d0ee53b5eb3..17c73850acb1 100644 --- a/crates/swc/tests/tsc-references/anyAsFunctionCall.1.normal.js +++ b/crates/swc/tests/tsc-references/anyAsFunctionCall.1.normal.js @@ -3,5 +3,5 @@ // can be called except with type arguments which is an error var x; var a = x(); -var b = x("hello"); +var b = x('hello'); var c = x(x); diff --git a/crates/swc/tests/tsc-references/anyAsFunctionCall.2.minified.js b/crates/swc/tests/tsc-references/anyAsFunctionCall.2.minified.js index ac558392334a..79fc9759084b 100644 --- a/crates/swc/tests/tsc-references/anyAsFunctionCall.2.minified.js +++ b/crates/swc/tests/tsc-references/anyAsFunctionCall.2.minified.js @@ -1,3 +1,3 @@ //// [anyAsFunctionCall.ts] var x; -x(), x("hello"), x(x); +x(), x('hello'), x(x); diff --git a/crates/swc/tests/tsc-references/anyAsGenericFunctionCall.1.normal.js b/crates/swc/tests/tsc-references/anyAsGenericFunctionCall.1.normal.js index 3090f2758aa5..ba9636a8e9f7 100644 --- a/crates/swc/tests/tsc-references/anyAsGenericFunctionCall.1.normal.js +++ b/crates/swc/tests/tsc-references/anyAsGenericFunctionCall.1.normal.js @@ -4,7 +4,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var x; var a = x(); -var b = x("hello"); +var b = x('hello'); var C = function C() { "use strict"; _class_call_check(this, C); diff --git a/crates/swc/tests/tsc-references/anyAsGenericFunctionCall.2.minified.js b/crates/swc/tests/tsc-references/anyAsGenericFunctionCall.2.minified.js index f0ce93d36f42..6d5353b5dac4 100644 --- a/crates/swc/tests/tsc-references/anyAsGenericFunctionCall.2.minified.js +++ b/crates/swc/tests/tsc-references/anyAsGenericFunctionCall.2.minified.js @@ -1,4 +1,4 @@ //// [anyAsGenericFunctionCall.ts] var x; import "@swc/helpers/_/_class_call_check"; -x(), x("hello"), x(x), x(x); +x(), x('hello'), x(x), x(x); diff --git a/crates/swc/tests/tsc-references/anyPropertyAccess.1.normal.js b/crates/swc/tests/tsc-references/anyPropertyAccess.1.normal.js index f53a8302f419..6063d35ffd18 100644 --- a/crates/swc/tests/tsc-references/anyPropertyAccess.1.normal.js +++ b/crates/swc/tests/tsc-references/anyPropertyAccess.1.normal.js @@ -1,8 +1,8 @@ //// [anyPropertyAccess.ts] var x; var a = x.foo; -var b = x["foo"]; -var c = x["fn"](); +var b = x['foo']; +var c = x['fn'](); var d = x.bar.baz; var e = x[0].foo; -var f = x["0"].bar; +var f = x['0'].bar; diff --git a/crates/swc/tests/tsc-references/anyPropertyAccess.2.minified.js b/crates/swc/tests/tsc-references/anyPropertyAccess.2.minified.js index 62128a3d88ee..f884080f1c16 100644 --- a/crates/swc/tests/tsc-references/anyPropertyAccess.2.minified.js +++ b/crates/swc/tests/tsc-references/anyPropertyAccess.2.minified.js @@ -1,3 +1,3 @@ //// [anyPropertyAccess.ts] var x; -x.foo, x.foo, x.fn(), x.bar.baz, x[0].foo, x["0"].bar; +x.foo, x.foo, x.fn(), x.bar.baz, x[0].foo, x['0'].bar; diff --git a/crates/swc/tests/tsc-references/arrayLiterals.1.normal.js b/crates/swc/tests/tsc-references/arrayLiterals.1.normal.js index 0d639466281b..27af359969fa 100644 --- a/crates/swc/tests/tsc-references/arrayLiterals.1.normal.js +++ b/crates/swc/tests/tsc-references/arrayLiterals.1.normal.js @@ -9,7 +9,7 @@ var arr1 = [ 1 ], [ - "" + '' ] ]; var arr2 = [ @@ -20,20 +20,20 @@ var arr2 = [ 1 ], [ - "" + '' ] ]; // Array literal with elements of only EveryType E has type E[] var stringArrArr = [ [ - "" + '' ], [ "" ] ]; var stringArr = [ - "", + '', "" ]; var numberArr = [ @@ -65,9 +65,9 @@ var classTypeArray; // Should OK, not be a parse error // Contextual type C with numeric index signature makes array literal of EveryType E of type BCT(E,C)[] var context1 = [ { - a: "", + a: '', b: 0, - c: "" + c: '' }, { a: "", @@ -77,9 +77,9 @@ var context1 = [ ]; var context2 = [ { - a: "", + a: '', b: 0, - c: "" + c: '' }, { a: "", diff --git a/crates/swc/tests/tsc-references/arrayOfFunctionTypes3.1.normal.js b/crates/swc/tests/tsc-references/arrayOfFunctionTypes3.1.normal.js index b6c30b119492..bd95d4cb1124 100644 --- a/crates/swc/tests/tsc-references/arrayOfFunctionTypes3.1.normal.js +++ b/crates/swc/tests/tsc-references/arrayOfFunctionTypes3.1.normal.js @@ -26,7 +26,7 @@ var z = [ c ]; var r4 = z[0]; -var r5 = r4(""); // any not string +var r5 = r4(''); // any not string var r5b = r4(1); var a2; var b2; @@ -37,4 +37,4 @@ var z2 = [ c2 ]; var r6 = z2[0]; -var r7 = r6(""); // any not string +var r7 = r6(''); // any not string diff --git a/crates/swc/tests/tsc-references/arrayOfFunctionTypes3.2.minified.js b/crates/swc/tests/tsc-references/arrayOfFunctionTypes3.2.minified.js index ca876cd96b64..6fdefdc23e71 100644 --- a/crates/swc/tests/tsc-references/arrayOfFunctionTypes3.2.minified.js +++ b/crates/swc/tests/tsc-references/arrayOfFunctionTypes3.2.minified.js @@ -8,8 +8,8 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; function() {} ][0](), new function C() { _class_call_check(this, C); -}(), a(""), a(1), (0, [ +}(), a(''), a(1), (0, [ a2, b2, c2 -][0])(""); +][0])(''); diff --git a/crates/swc/tests/tsc-references/arraySpreadInCall.1.normal.js b/crates/swc/tests/tsc-references/arraySpreadInCall.1.normal.js index ff4a710da5f6..b030401b54b7 100644 --- a/crates/swc/tests/tsc-references/arraySpreadInCall.1.normal.js +++ b/crates/swc/tests/tsc-references/arraySpreadInCall.1.normal.js @@ -50,60 +50,60 @@ f1.apply(void 0, [ ]); var x21 = f2.apply(void 0, [ 1, - "foo" + 'foo' ]); var x22 = f2.apply(void 0, [ true, 1, - "foo" + 'foo' ]); var x23 = f2.apply(void 0, [ 1, - "foo" + 'foo' ]); var x24 = f2.apply(void 0, [ true, 1, - "foo" + 'foo' ]); var x31 = f3.apply(void 0, [ 1, - "foo" + 'foo' ]); var x32 = f3.apply(void 0, [ true, 1, - "foo" + 'foo' ]); var x33 = f3.apply(void 0, [ 1, - "foo" + 'foo' ]); var x34 = f3.apply(void 0, [ true, 1, - "foo" + 'foo' ]); var x41 = f4.apply(void 0, [ 1, - "foo" + 'foo' ]); var x42 = f4.apply(void 0, [ true, 1, - "foo" + 'foo' ]); var x43 = f4.apply(void 0, [ 1, - "foo" + 'foo' ]); var x44 = f4.apply(void 0, [ true, 1, - "foo" + 'foo' ]); (_action = action).run.apply(_action, [ 100, - "foo" + 'foo' ] // error ); diff --git a/crates/swc/tests/tsc-references/arraySpreadInCall.2.minified.js b/crates/swc/tests/tsc-references/arraySpreadInCall.2.minified.js index c255e2335848..4cef37d97487 100644 --- a/crates/swc/tests/tsc-references/arraySpreadInCall.2.minified.js +++ b/crates/swc/tests/tsc-references/arraySpreadInCall.2.minified.js @@ -44,47 +44,47 @@ f1.apply(void 0, [ 6 ]), f2.apply(void 0, [ 1, - "foo" + 'foo' ]), f2.apply(void 0, [ !0, 1, - "foo" + 'foo' ]), f2.apply(void 0, [ 1, - "foo" + 'foo' ]), f2.apply(void 0, [ !0, 1, - "foo" + 'foo' ]), f3.apply(void 0, [ 1, - "foo" + 'foo' ]), f3.apply(void 0, [ !0, 1, - "foo" + 'foo' ]), f3.apply(void 0, [ 1, - "foo" + 'foo' ]), f3.apply(void 0, [ !0, 1, - "foo" + 'foo' ]), f4.apply(void 0, [ 1, - "foo" + 'foo' ]), f4.apply(void 0, [ !0, 1, - "foo" + 'foo' ]), f4.apply(void 0, [ 1, - "foo" + 'foo' ]), f4.apply(void 0, [ !0, 1, - "foo" + 'foo' ]), (_action = action).run.apply(_action, [ 100, - "foo" + 'foo' ]); diff --git a/crates/swc/tests/tsc-references/arrowFunctionExpressions.1.normal.js b/crates/swc/tests/tsc-references/arrowFunctionExpressions.1.normal.js index 3de25e43dc64..7b13a05a1074 100644 --- a/crates/swc/tests/tsc-references/arrowFunctionExpressions.1.normal.js +++ b/crates/swc/tests/tsc-references/arrowFunctionExpressions.1.normal.js @@ -108,7 +108,7 @@ function someFn() { // Arrow function used in function function someOtherFn() { var arr = function(n) { - return "" + n; + return '' + n; }; arr(4).charAt(0); } @@ -129,7 +129,7 @@ var f = function(n) { }; return fn(4); }; -var g = f("")(); +var g = f('')(); var g; // Arrow function used in nested function in arrow function in nested function function someOuterFn() { @@ -143,7 +143,7 @@ function someOuterFn() { }; return arr; } -var h = someOuterFn()("")()(); +var h = someOuterFn()('')()(); h.toExponential(); // Arrow function used in try/catch/finally in function function tryCatchFn() { @@ -158,7 +158,7 @@ function tryCatchFn() { }; } finally{ var m = function() { - return _this + ""; + return _this + ''; }; } } diff --git a/crates/swc/tests/tsc-references/asOperator1.1.normal.js b/crates/swc/tests/tsc-references/asOperator1.1.normal.js index 6999741334d6..5c64736c916d 100644 --- a/crates/swc/tests/tsc-references/asOperator1.1.normal.js +++ b/crates/swc/tests/tsc-references/asOperator1.1.normal.js @@ -5,4 +5,4 @@ var y = null.length; var z = Date; // Should parse as a union type, not a bitwise 'or' of (32 as number) and 'string' var j = 32; -j = ""; +j = ''; diff --git a/crates/swc/tests/tsc-references/assignFromStringInterface.1.normal.js b/crates/swc/tests/tsc-references/assignFromStringInterface.1.normal.js index 2bae2316746f..fabc0e2e5938 100644 --- a/crates/swc/tests/tsc-references/assignFromStringInterface.1.normal.js +++ b/crates/swc/tests/tsc-references/assignFromStringInterface.1.normal.js @@ -1,5 +1,5 @@ //// [assignFromStringInterface.ts] -var x = ""; +var x = ''; var a; x = a; a = x; diff --git a/crates/swc/tests/tsc-references/assignFromStringInterface2.1.normal.js b/crates/swc/tests/tsc-references/assignFromStringInterface2.1.normal.js index 9ff077983523..69e2e77df0d3 100644 --- a/crates/swc/tests/tsc-references/assignFromStringInterface2.1.normal.js +++ b/crates/swc/tests/tsc-references/assignFromStringInterface2.1.normal.js @@ -1,5 +1,5 @@ //// [assignFromStringInterface2.ts] -var x = ""; +var x = ''; var a; var b; a = x; diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures.1.normal.js index a31db1997735..3d32b5a93eb3 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures.1.normal.js @@ -17,7 +17,7 @@ t = function() { return 1; }; t = function t(x) { - return ""; + return ''; }; a = function(x) { return 1; @@ -26,7 +26,7 @@ a = function() { return 1; }; a = function a(x) { - return ""; + return ''; }; var s2; var a3; @@ -37,7 +37,7 @@ t = function(x) { return 1; }; t = function t(x) { - return ""; + return ''; }; a = s2; a = a3; @@ -45,5 +45,5 @@ a = function(x) { return 1; }; a = function a(x) { - return ""; + return ''; }; diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures2.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures2.1.normal.js index 83d672b3bcc8..c914454a3aea 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures2.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithCallSignatures2.1.normal.js @@ -27,7 +27,7 @@ t = { }; t = { f: function f(x) { - return ""; + return ''; } }; a = { @@ -42,7 +42,7 @@ a = { }; a = { f: function f(x) { - return ""; + return ''; } }; // errors @@ -50,13 +50,13 @@ t = function() { return 1; }; t = function t(x) { - return ""; + return ''; }; a = function() { return 1; }; a = function a(x) { - return ""; + return ''; }; var s2; var a3; @@ -67,7 +67,7 @@ t = function(x) { return 1; }; t = function t(x) { - return ""; + return ''; }; a = s2; a = a3; @@ -75,5 +75,5 @@ a = function(x) { return 1; }; a = function a(x) { - return ""; + return ''; }; diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures.1.normal.js index b9dedb1aa510..a19f73a9564e 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures.1.normal.js @@ -19,7 +19,7 @@ t = function(x) { return 1; }; t = function t(x) { - return ""; + return ''; }; a = s2; a = a3; @@ -27,5 +27,5 @@ a = function(x) { return 1; }; a = function a(x) { - return ""; + return ''; }; diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures2.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures2.1.normal.js index 7790b12e4879..35a9c3cc9037 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures2.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithConstructSignatures2.1.normal.js @@ -15,13 +15,13 @@ t = function() { return 1; }; t = function t(x) { - return ""; + return ''; }; a = function() { return 1; }; a = function a(x) { - return ""; + return ''; }; var s2; var a3; @@ -32,7 +32,7 @@ t = function(x) { return 1; }; t = function t(x) { - return ""; + return ''; }; a = s2; a = a3; @@ -40,5 +40,5 @@ a = function(x) { return 1; }; a = function a(x) { - return ""; + return ''; }; diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion.1.normal.js index f80acf45db63..4b5a535f7b9c 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion.1.normal.js @@ -91,7 +91,7 @@ var GH15907; function dispatchAction(action) {} var active = true; dispatchAction({ - type: active ? "disactivate" : "activate" + type: active ? 'disactivate' : 'activate' }); })(GH15907 || (GH15907 = {})); var GH20889; diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers.1.normal.js index 849f1cfac2c8..b35b18cfc352 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers.1.normal.js @@ -19,10 +19,10 @@ var SimpleTypes; var a; var b; var a2 = { - foo: "" + foo: '' }; var b2 = { - foo: "" + foo: '' }; s = t; t = s; diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers2.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers2.1.normal.js index 4c92548c3915..17a1fb6bb01b 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers2.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers2.1.normal.js @@ -17,10 +17,10 @@ var t2; var a; var b; var a2 = { - foo: "" + foo: '' }; var b2 = { - foo: "" + foo: '' }; s = t; t = s; diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers3.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers3.1.normal.js index 9464523aa365..9637dd4dabb5 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers3.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembers3.1.normal.js @@ -17,10 +17,10 @@ var t2; var a; var b; var a2 = { - foo: "" + foo: '' }; var b2 = { - foo: "" + foo: '' }; s = t; t = s; diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersNumericNames.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersNumericNames.1.normal.js index ae63657d8b25..5c382e939467 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersNumericNames.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersNumericNames.1.normal.js @@ -17,10 +17,10 @@ var t2; var a; var b; var a2 = { - 1.0: "" + 1.0: '' }; var b2 = { - 1: "" + 1: '' }; s = t; t = s; diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames.1.normal.js index d8d0378e3195..1b53c63a758a 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithObjectMembersStringNumericNames.1.normal.js @@ -19,10 +19,10 @@ var JustStrings; var a; var b; var a2 = { - "1.0": "" + '1.0': '' }; var b2 = { - "1": "" + '1': '' }; s = t; t = s; @@ -61,10 +61,10 @@ var NumbersAndStrings; var a; var b; var a2 = { - "1.0": "" + '1.0': '' }; var b2 = { - 1.: "" + 1.: '' }; s = t; // ok t = s; // ok diff --git a/crates/swc/tests/tsc-references/assignmentLHSIsReference.1.normal.js b/crates/swc/tests/tsc-references/assignmentLHSIsReference.1.normal.js index a6459e12f7a7..8fc9c03c3823 100644 --- a/crates/swc/tests/tsc-references/assignmentLHSIsReference.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentLHSIsReference.1.normal.js @@ -9,11 +9,11 @@ function fn1(x2) { // property accesses var x3; x3.a = value; -x3["a"] = value; +x3['a'] = value; // parentheses, the contained expression is reference x1 = value; function fn2(x4) { x4 = value; } x3.a = value; -x3["a"] = value; +x3['a'] = value; diff --git a/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers.1.normal.js b/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers.1.normal.js index b7afcc191b12..bfc37054f5ef 100644 --- a/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers.1.normal.js +++ b/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers.1.normal.js @@ -3,16 +3,16 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var x; x = 3; // OK x = 3; // OK -x = ""; // Error -x = ""; // Error +x = ''; // Error +x = ''; // Error var M; (function(M) {})(M || (M = {})); M.y = 3; // OK M.y = 3; // OK M.y = 3; // OK -M.y = ""; // Error -M.y = ""; // Error -M.y = ""; // Error +M.y = ''; // Error +M.y = ''; // Error +M.y = ''; // Error M = { y: 3 }; // Error @@ -37,13 +37,13 @@ M2.M3 = { x: 3 }; // OK M2.M3 = { - x: "" + x: '' }; // Error M2.M3 = { - x: "" + x: '' }; // Error M2.M3 = { - x: "" + x: '' }; // Error function fn() {} fn = function() { @@ -55,18 +55,18 @@ fn = function() { function fn2(x, y) { x = 3; x = 3; // OK - x = ""; // Error - x = ""; // Error + x = ''; // Error + x = ''; // Error y.t = 3; // OK y.t = 3; // OK - y.t = ""; // Error - y.t = ""; // Error - y["t"] = 3; // OK - y["t"] = 3; // OK - y["t"] = 3; // OK - y["t"] = ""; // Error - y["t"] = ""; // Error - y["t"] = ""; // Error + y.t = ''; // Error + y.t = ''; // Error + y['t'] = 3; // OK + y['t'] = 3; // OK + y['t'] = 3; // OK + y['t'] = ''; // Error + y['t'] = ''; // Error + y['t'] = ''; // Error } var E; (function(E) { diff --git a/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers.2.minified.js b/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers.2.minified.js index 2035073f6105..8c72491cd01b 100644 --- a/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentToParenthesizedIdentifiers.2.minified.js @@ -1,7 +1,7 @@ //// [assignmentToParenthesizedIdentifiers.ts] var M, M2, E, M21, E1; import "@swc/helpers/_/_class_call_check"; -M || (M = {}), M.y = 3, M.y = 3, M.y = 3, M.y = "", M.y = "", M.y = "", M = { +M || (M = {}), M.y = 3, M.y = 3, M.y = 3, M.y = '', M.y = '', M.y = '', M = { y: 3 }, M = { y: 3 @@ -12,9 +12,9 @@ M || (M = {}), M.y = 3, M.y = 3, M.y = 3, M.y = "", M.y = "", M.y = "", M = { }, M2.M3 = { x: 3 }, M2.M3 = { - x: "" + x: '' }, M2.M3 = { - x: "" + x: '' }, M2.M3 = { - x: "" + x: '' }, (E1 = E || (E = {}))[E1.A = 0] = "A"; diff --git a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2.1.normal.js b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2.1.normal.js index d2e065fc769a..3d69e93fcb5e 100644 --- a/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2.1.normal.js +++ b/crates/swc/tests/tsc-references/bestCommonTypeOfConditionalExpressions2.1.normal.js @@ -31,7 +31,7 @@ var Derived2 = /*#__PURE__*/ function(Base) { var base; var derived; var derived2; -var r2 = true ? 1 : ""; +var r2 = true ? 1 : ''; var r9 = true ? derived : derived2; function foo(t, u) { return true ? t : u; diff --git a/crates/swc/tests/tsc-references/booleanPropertyAccess.1.normal.js b/crates/swc/tests/tsc-references/booleanPropertyAccess.1.normal.js index 46c895aacee4..d715b2daa52d 100644 --- a/crates/swc/tests/tsc-references/booleanPropertyAccess.1.normal.js +++ b/crates/swc/tests/tsc-references/booleanPropertyAccess.1.normal.js @@ -1,4 +1,4 @@ //// [booleanPropertyAccess.ts] var x = true; var a = x.toString(); -var b = x["toString"](); +var b = x['toString'](); diff --git a/crates/swc/tests/tsc-references/callGenericFunctionWithIncorrectNumberOfTypeArguments.1.normal.js b/crates/swc/tests/tsc-references/callGenericFunctionWithIncorrectNumberOfTypeArguments.1.normal.js index 186a9a9fe510..50833b7e5b49 100644 --- a/crates/swc/tests/tsc-references/callGenericFunctionWithIncorrectNumberOfTypeArguments.1.normal.js +++ b/crates/swc/tests/tsc-references/callGenericFunctionWithIncorrectNumberOfTypeArguments.1.normal.js @@ -5,16 +5,16 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; function f(x, y) { return null; } -var r1 = f(1, ""); -var r1b = f(1, ""); +var r1 = f(1, ''); +var r1b = f(1, ''); var f2 = function(x, y) { return null; }; -var r2 = f2(1, ""); -var r2b = f2(1, ""); +var r2 = f2(1, ''); +var r2b = f2(1, ''); var f3; -var r3 = f3(1, ""); -var r3b = f3(1, ""); +var r3 = f3(1, ''); +var r3b = f3(1, ''); var C = /*#__PURE__*/ function() { "use strict"; function C() { @@ -26,11 +26,11 @@ var C = /*#__PURE__*/ function() { }; return C; }(); -var r4 = new C().f(1, ""); -var r4b = new C().f(1, ""); +var r4 = new C().f(1, ''); +var r4b = new C().f(1, ''); var i; -var r5 = i.f(1, ""); -var r5b = i.f(1, ""); +var r5 = i.f(1, ''); +var r5b = i.f(1, ''); var C2 = /*#__PURE__*/ function() { "use strict"; function C2() { @@ -42,8 +42,8 @@ var C2 = /*#__PURE__*/ function() { }; return C2; }(); -var r6 = new C2().f(1, ""); -var r6b = new C2().f(1, ""); +var r6 = new C2().f(1, ''); +var r6b = new C2().f(1, ''); var i2; -var r7 = i2.f(1, ""); -var r7b = i2.f(1, ""); +var r7 = i2.f(1, ''); +var r7b = i2.f(1, ''); diff --git a/crates/swc/tests/tsc-references/callGenericFunctionWithIncorrectNumberOfTypeArguments.2.minified.js b/crates/swc/tests/tsc-references/callGenericFunctionWithIncorrectNumberOfTypeArguments.2.minified.js index 9eff218dddbc..19c47cb5cc51 100644 --- a/crates/swc/tests/tsc-references/callGenericFunctionWithIncorrectNumberOfTypeArguments.2.minified.js +++ b/crates/swc/tests/tsc-references/callGenericFunctionWithIncorrectNumberOfTypeArguments.2.minified.js @@ -3,7 +3,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var f3, i, i2, f2 = function(x, y) { return null; }; -f2(1, ""), f2(1, ""), f3(1, ""), f3(1, ""); +f2(1, ''), f2(1, ''), f3(1, ''), f3(1, ''); var C = function() { function C() { _class_call_check(this, C); @@ -12,7 +12,7 @@ var C = function() { return null; }, C; }(); -new C().f(1, ""), new C().f(1, ""), i.f(1, ""), i.f(1, ""); +new C().f(1, ''), new C().f(1, ''), i.f(1, ''), i.f(1, ''); var C2 = function() { function C2() { _class_call_check(this, C2); @@ -21,4 +21,4 @@ var C2 = function() { return null; }, C2; }(); -new C2().f(1, ""), new C2().f(1, ""), i2.f(1, ""), i2.f(1, ""); +new C2().f(1, ''), new C2().f(1, ''), i2.f(1, ''), i2.f(1, ''); diff --git a/crates/swc/tests/tsc-references/callOverload.1.normal.js b/crates/swc/tests/tsc-references/callOverload.1.normal.js index f8baac24ba92..2abcadfeb2e3 100644 --- a/crates/swc/tests/tsc-references/callOverload.1.normal.js +++ b/crates/swc/tests/tsc-references/callOverload.1.normal.js @@ -6,7 +6,7 @@ fn(1) // no error fn(1, 2, 3, 4); takeTwo(1, 2, 3, 4); withRest.apply(void 0, [ - "a" + 'a' ].concat(_to_consumable_array(n))); // no error withRest(); withRest.apply(void 0, _to_consumable_array(n)); diff --git a/crates/swc/tests/tsc-references/callOverload.2.minified.js b/crates/swc/tests/tsc-references/callOverload.2.minified.js index 52affc4642f3..0dce7c260acb 100644 --- a/crates/swc/tests/tsc-references/callOverload.2.minified.js +++ b/crates/swc/tests/tsc-references/callOverload.2.minified.js @@ -2,5 +2,5 @@ var n; import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array"; fn(1), fn(1, 2, 3, 4), takeTwo(1, 2, 3, 4), withRest.apply(void 0, [ - "a" + 'a' ].concat(_to_consumable_array(n))), withRest(), withRest.apply(void 0, _to_consumable_array(n)); diff --git a/crates/swc/tests/tsc-references/callSignaturesThatDifferOnlyByReturnType2.1.normal.js b/crates/swc/tests/tsc-references/callSignaturesThatDifferOnlyByReturnType2.1.normal.js index 0abc04b2d5df..87022c89a733 100644 --- a/crates/swc/tests/tsc-references/callSignaturesThatDifferOnlyByReturnType2.1.normal.js +++ b/crates/swc/tests/tsc-references/callSignaturesThatDifferOnlyByReturnType2.1.normal.js @@ -4,4 +4,4 @@ var x; // BUG 822524 var r = x.foo(1); // no error -var r2 = x.foo(""); // error +var r2 = x.foo(''); // error diff --git a/crates/swc/tests/tsc-references/callSignaturesThatDifferOnlyByReturnType2.2.minified.js b/crates/swc/tests/tsc-references/callSignaturesThatDifferOnlyByReturnType2.2.minified.js index 76ef58ee272a..081c2aeab695 100644 --- a/crates/swc/tests/tsc-references/callSignaturesThatDifferOnlyByReturnType2.2.minified.js +++ b/crates/swc/tests/tsc-references/callSignaturesThatDifferOnlyByReturnType2.2.minified.js @@ -1,3 +1,3 @@ //// [callSignaturesThatDifferOnlyByReturnType2.ts] var x; -x.foo(1), x.foo(""); +x.foo(1), x.foo(''); diff --git a/crates/swc/tests/tsc-references/callWithSpread3.1.normal.js b/crates/swc/tests/tsc-references/callWithSpread3.1.normal.js index cdff44697dd1..64cf17a38dbb 100644 --- a/crates/swc/tests/tsc-references/callWithSpread3.1.normal.js +++ b/crates/swc/tests/tsc-references/callWithSpread3.1.normal.js @@ -2,28 +2,28 @@ import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array"; // error fs2.apply(void 0, [ - "a" + 'a' ].concat(_to_consumable_array(s2))); // error on ...s2 fs2.apply(void 0, [ - "a", - "b", - "c" + 'a', + 'b', + 'c' ].concat(_to_consumable_array(s2))); // error on 'c' and ...s2 fs2.apply(void 0, [ - "a", - "b" + 'a', + 'b' ].concat(_to_consumable_array(s2), [ - "c" + 'c' ])); // error on ...s2 and 'c' fs2.apply(void 0, [ - "a", - "b", - "c" + 'a', + 'b', + 'c' ].concat(_to_consumable_array(s2), [ - "d" + 'd' ])); // error on 'c', ...s2 and 'd' fs2.apply(void 0, _to_consumable_array(s2).concat([ - "a" + 'a' ])); // error on 'a' fs2.apply(void 0, _to_consumable_array(s3)); // error on ...s3 fs2_.apply(void 0, _to_consumable_array(s_)); // error on ...s_ diff --git a/crates/swc/tests/tsc-references/callWithSpread3.2.minified.js b/crates/swc/tests/tsc-references/callWithSpread3.2.minified.js index c8e91d756f86..277c8414a0fd 100644 --- a/crates/swc/tests/tsc-references/callWithSpread3.2.minified.js +++ b/crates/swc/tests/tsc-references/callWithSpread3.2.minified.js @@ -1,24 +1,24 @@ //// [callWithSpread3.ts] import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array"; fs2.apply(void 0, [ - "a" + 'a' ].concat(_to_consumable_array(s2))), fs2.apply(void 0, [ - "a", - "b", - "c" + 'a', + 'b', + 'c' ].concat(_to_consumable_array(s2))), fs2.apply(void 0, [ - "a", - "b" + 'a', + 'b' ].concat(_to_consumable_array(s2), [ - "c" + 'c' ])), fs2.apply(void 0, [ - "a", - "b", - "c" + 'a', + 'b', + 'c' ].concat(_to_consumable_array(s2), [ - "d" + 'd' ])), fs2.apply(void 0, _to_consumable_array(s2).concat([ - "a" + 'a' ])), fs2.apply(void 0, _to_consumable_array(s3)), fs2_.apply(void 0, _to_consumable_array(s_)), fs2_.apply(void 0, _to_consumable_array(s2n_)), fs2_.apply(void 0, _to_consumable_array(s_).concat(_to_consumable_array(s_))), fs2_.apply(void 0, _to_consumable_array(s_).concat(_to_consumable_array(s_), _to_consumable_array(s_))), fs2n_.apply(void 0, _to_consumable_array(s2_)), fs2_.apply(void 0, _to_consumable_array(s2_)), fs2_.apply(void 0, _to_consumable_array(s2_).concat(_to_consumable_array(s_))), fs2_.apply(void 0, _to_consumable_array(s2_).concat(_to_consumable_array(s2_))), fs2_.apply(void 0, _to_consumable_array(s_).concat(_to_consumable_array(s2_))), fs2n_.apply(void 0, _to_consumable_array(s2n_)), fs2n_.apply(void 0, _to_consumable_array(s2)), fs5.apply(void 0, _to_consumable_array(s2).concat([ "foo" ], _to_consumable_array(s2))); diff --git a/crates/swc/tests/tsc-references/callbackTagNamespace.1.normal.js b/crates/swc/tests/tsc-references/callbackTagNamespace.1.normal.js index b07c748a3e9d..96a21979b689 100644 --- a/crates/swc/tests/tsc-references/callbackTagNamespace.1.normal.js +++ b/crates/swc/tests/tsc-references/callbackTagNamespace.1.normal.js @@ -6,5 +6,5 @@ * @return {string | number} */ var x = 1; /** @type {NS.Nested.Inner} */ function f(space, peace) { - return "1"; + return '1'; } diff --git a/crates/swc/tests/tsc-references/callbackTagVariadicType.1.normal.js b/crates/swc/tests/tsc-references/callbackTagVariadicType.1.normal.js index 778a083177d7..b12c4dd5a458 100644 --- a/crates/swc/tests/tsc-references/callbackTagVariadicType.1.normal.js +++ b/crates/swc/tests/tsc-references/callbackTagVariadicType.1.normal.js @@ -6,4 +6,4 @@ */ /** @type {Foo} */ export var x = function() { return 1; }; -var res = x("a", "b"); +var res = x('a', 'b'); diff --git a/crates/swc/tests/tsc-references/callbackTagVariadicType.2.minified.js b/crates/swc/tests/tsc-references/callbackTagVariadicType.2.minified.js index 007fd9dbb7b6..5b7c15214b46 100644 --- a/crates/swc/tests/tsc-references/callbackTagVariadicType.2.minified.js +++ b/crates/swc/tests/tsc-references/callbackTagVariadicType.2.minified.js @@ -2,4 +2,4 @@ export var x = function() { return 1; }; -x("a", "b"); +x('a', 'b'); diff --git a/crates/swc/tests/tsc-references/chained.1.normal.js b/crates/swc/tests/tsc-references/chained.1.normal.js index 5d5c8b0531cd..d01c5e05a756 100644 --- a/crates/swc/tests/tsc-references/chained.1.normal.js +++ b/crates/swc/tests/tsc-references/chained.1.normal.js @@ -6,10 +6,10 @@ var A = function A() { }; export { }; //// [/b.ts] -export { B as C } from "./a"; +export { B as C } from './a'; //// [/c.ts] export { }; //// [/d.ts] -import { D } from "./c"; +import { D } from './c'; new D(); var d = {}; diff --git a/crates/swc/tests/tsc-references/chained.2.minified.js b/crates/swc/tests/tsc-references/chained.2.minified.js index 3ea50d48a55a..7c118e510332 100644 --- a/crates/swc/tests/tsc-references/chained.2.minified.js +++ b/crates/swc/tests/tsc-references/chained.2.minified.js @@ -1,9 +1,9 @@ //// [/a.ts] import "@swc/helpers/_/_class_call_check"; //// [/b.ts] -export { B as C } from "./a"; +export { B as C } from './a'; //// [/c.ts] export { }; //// [/d.ts] -import { D } from "./c"; +import { D } from './c'; new D(); diff --git a/crates/swc/tests/tsc-references/chained2.1.normal.js b/crates/swc/tests/tsc-references/chained2.1.normal.js index e57436f31f72..fbfb6ea884ea 100644 --- a/crates/swc/tests/tsc-references/chained2.1.normal.js +++ b/crates/swc/tests/tsc-references/chained2.1.normal.js @@ -6,13 +6,13 @@ var A = function A() { }; export { }; //// [/b.ts] -import A from "./a"; +import A from './a'; export { A }; //// [/c.ts] -import * as types from "./b"; +import * as types from './b'; export { types as default }; //// [/d.ts] -import types from "./c"; +import types from './c'; new types.A(); new types.B(); var a = {}; diff --git a/crates/swc/tests/tsc-references/chained2.2.minified.js b/crates/swc/tests/tsc-references/chained2.2.minified.js index 5203417445d9..1f7bfc7a55c5 100644 --- a/crates/swc/tests/tsc-references/chained2.2.minified.js +++ b/crates/swc/tests/tsc-references/chained2.2.minified.js @@ -1,11 +1,11 @@ //// [/a.ts] import "@swc/helpers/_/_class_call_check"; //// [/b.ts] -import A from "./a"; +import A from './a'; export { A }; //// [/c.ts] -import * as types from "./b"; +import * as types from './b'; export { types as default }; //// [/d.ts] -import types from "./c"; +import types from './c'; new types.A(), new types.B(); diff --git a/crates/swc/tests/tsc-references/chainedPrototypeAssignment.1.normal.js b/crates/swc/tests/tsc-references/chainedPrototypeAssignment.1.normal.js index bd7df2f90556..a283a62fd850 100644 --- a/crates/swc/tests/tsc-references/chainedPrototypeAssignment.1.normal.js +++ b/crates/swc/tests/tsc-references/chainedPrototypeAssignment.1.normal.js @@ -16,8 +16,8 @@ A.prototype = B.prototype = { }; //// [use.js] /// -var mod = require("./mod"); +var mod = require('./mod'); var a = new mod.A(); var b = new mod.B(); -a.m("nope"); -b.m("not really"); +a.m('nope'); +b.m('not really'); diff --git a/crates/swc/tests/tsc-references/chainedPrototypeAssignment.2.minified.js b/crates/swc/tests/tsc-references/chainedPrototypeAssignment.2.minified.js index 5a570836de7f..62647c2bdcd3 100644 --- a/crates/swc/tests/tsc-references/chainedPrototypeAssignment.2.minified.js +++ b/crates/swc/tests/tsc-references/chainedPrototypeAssignment.2.minified.js @@ -11,5 +11,5 @@ exports.A = A, exports.B = B, A.prototype = B.prototype = { } }; //// [use.js] -var mod = require("./mod"), a = new mod.A(), b = new mod.B(); -a.m("nope"), b.m("not really"); +var mod = require('./mod'), a = new mod.A(), b = new mod.B(); +a.m('nope'), b.m('not really'); diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag1.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag1.1.normal.js index 180c4ff04542..5165b87e56ea 100644 --- a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag1.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag1.1.normal.js @@ -30,9 +30,9 @@ var t6 = /** @satisfies {[number, number]} */ [ 2 ]; var t7 = /** @satisfies {T4} */ { - a: "test" + a: 'test' }; var t8 = /** @satisfies {T4} */ { - a: "test", - b: "test" + a: 'test', + b: 'test' }; diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag12.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag12.1.normal.js index 42b601d83d92..5211896db69a 100644 --- a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag12.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag12.1.normal.js @@ -32,13 +32,13 @@ /** * @satisfies {T2} */ var t5 = { - a: "test" + a: 'test' }; /** * @satisfies {T2} */ var t6 = { - a: "test", - b: "test" + a: 'test', + b: 'test' }; /** * @satisfies {T3} diff --git a/crates/swc/tests/tsc-references/checkJsdocTypeTag5.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocTypeTag5.1.normal.js index 2c2b6e8819dc..5dcb11de71d5 100644 --- a/crates/swc/tests/tsc-references/checkJsdocTypeTag5.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocTypeTag5.1.normal.js @@ -21,8 +21,8 @@ /** @typedef {(x: 'hi' | 'bye') => 0 | 1 | 2} Argle */ /** @type {Argle} */ function blargle(s) { return 0; } -/** @type {0 | 1 | 2} - assignment should not error */ var zeroonetwo = blargle("hi"); +/** @type {0 | 1 | 2} - assignment should not error */ var zeroonetwo = blargle('hi'); /** @typedef {{(s: string): 0 | 1; (b: boolean): 2 | 3 }} Gioconda */ /** @type {Gioconda} */ function monaLisa(sb) { - return typeof sb === "string" ? 1 : 2; + return typeof sb === 'string' ? 1 : 2; } /** @type {2 | 3} - overloads are not supported, so there will be an error */ var twothree = monaLisa(false); diff --git a/crates/swc/tests/tsc-references/checkJsdocTypeTagOnObjectProperty1.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocTypeTagOnObjectProperty1.1.normal.js index 533fe3878257..206142a1f5a7 100644 --- a/crates/swc/tests/tsc-references/checkJsdocTypeTagOnObjectProperty1.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocTypeTagOnObjectProperty1.1.normal.js @@ -11,10 +11,10 @@ var obj = (_obj = { return n1 + 42; }, /** @type {string} */ lol: lol -}, /** @type {number} */ _define_property(_obj, "b" + "ar1", 42), /** @type {function(number): number} */ _define_property(_obj, "arrowFunc", function(num) { +}, /** @type {number} */ _define_property(_obj, 'b' + 'ar1', 42), /** @type {function(number): number} */ _define_property(_obj, "arrowFunc", function(num) { return num + 42; }), _obj); -obj.foo = "string"; +obj.foo = 'string'; obj.lol; obj.bar = undefined; var k = obj.method1(0); diff --git a/crates/swc/tests/tsc-references/checkJsdocTypeTagOnObjectProperty1.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocTypeTagOnObjectProperty1.2.minified.js index d786aeceb596..dc178b17db6b 100644 --- a/crates/swc/tests/tsc-references/checkJsdocTypeTagOnObjectProperty1.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsdocTypeTagOnObjectProperty1.2.minified.js @@ -11,4 +11,4 @@ var _obj, obj = (_define_property(_obj = { }, "bar1", 42), _define_property(_obj, "arrowFunc", function(num) { return num + 42; }), _obj); -obj.foo = "string", obj.lol, obj.bar = void 0, obj.method1(0), obj.bar1 = "42", obj.arrowFunc(0); +obj.foo = 'string', obj.lol, obj.bar = void 0, obj.method1(0), obj.bar1 = "42", obj.arrowFunc(0); diff --git a/crates/swc/tests/tsc-references/checkJsdocTypedefInParamTag1.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocTypedefInParamTag1.1.normal.js index cca311b837a9..58e385df9297 100644 --- a/crates/swc/tests/tsc-references/checkJsdocTypedefInParamTag1.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocTypedefInParamTag1.1.normal.js @@ -13,7 +13,7 @@ opts.x; } foo({ - x: "abc" + x: 'abc' }); /** * @typedef {Object} AnotherOpts @@ -39,5 +39,5 @@ foo1({ opts.x; } foo2({ - x: "abc" + x: 'abc' }); diff --git a/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile.1.normal.js index 0c12aa3f4cc2..f4a014839460 100644 --- a/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocTypedefOnlySourceFile.1.normal.js @@ -5,4 +5,4 @@ var exports = {}; /** * @typedef {string} */ exports.SomeName; -/** @type {exports.SomeName} */ var myString = "str"; +/** @type {exports.SomeName} */ var myString = 'str'; diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleType.1.normal.js b/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleType.1.normal.js index f73f7852af18..75f8a05e1cdf 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleType.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleType.1.normal.js @@ -3,7 +3,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -import React from "react"; +import React from 'react'; var ResizablePanel = /*#__PURE__*/ function(_React_Component) { "use strict"; _inherits(ResizablePanel, _React_Component); diff --git a/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleType.2.minified.js b/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleType.2.minified.js index b51cc415a15d..b99492946f33 100644 --- a/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleType.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsxChildrenCanBeTupleType.2.minified.js @@ -2,5 +2,5 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -import React from "react"; +import React from 'react'; React.Component; diff --git a/crates/swc/tests/tsc-references/checkJsxUnionSFXContextualTypeInferredCorrectly.1.normal.js b/crates/swc/tests/tsc-references/checkJsxUnionSFXContextualTypeInferredCorrectly.1.normal.js index 1699f4b3d115..30018c09b792 100644 --- a/crates/swc/tests/tsc-references/checkJsxUnionSFXContextualTypeInferredCorrectly.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsxUnionSFXContextualTypeInferredCorrectly.1.normal.js @@ -1,6 +1,6 @@ //// [checkJsxUnionSFXContextualTypeInferredCorrectly.tsx] /// -import React from "react"; +import React from 'react'; export function ComponentWithUnion(props) { return /*#__PURE__*/ React.createElement("h1", null); } @@ -8,7 +8,7 @@ export function ComponentWithUnion(props) { export function HereIsTheError() { return /*#__PURE__*/ React.createElement(ComponentWithUnion, { multi: false, - value: "s", + value: 's', onChange: function(val) { return console.log(val); } @@ -17,7 +17,7 @@ export function HereIsTheError() { // Usage with pure TypeScript ComponentWithUnion({ multi: false, - value: "s", + value: 's', onChange: function(val) { return console.log(val) // <- this works fine ; diff --git a/crates/swc/tests/tsc-references/checkJsxUnionSFXContextualTypeInferredCorrectly.2.minified.js b/crates/swc/tests/tsc-references/checkJsxUnionSFXContextualTypeInferredCorrectly.2.minified.js index b00188e8bc8d..542d5c237bfa 100644 --- a/crates/swc/tests/tsc-references/checkJsxUnionSFXContextualTypeInferredCorrectly.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsxUnionSFXContextualTypeInferredCorrectly.2.minified.js @@ -1,12 +1,12 @@ //// [checkJsxUnionSFXContextualTypeInferredCorrectly.tsx] -import React from "react"; +import React from 'react'; export function ComponentWithUnion(props) { return React.createElement("h1", null); } export function HereIsTheError() { return React.createElement(ComponentWithUnion, { multi: !1, - value: "s", + value: 's', onChange: function(val) { return console.log(val); } @@ -14,7 +14,7 @@ export function HereIsTheError() { } ComponentWithUnion({ multi: !1, - value: "s", + value: 's', onChange: function(val) { return console.log(val); } diff --git a/crates/swc/tests/tsc-references/classAppearsToHaveMembersOfObject.1.normal.js b/crates/swc/tests/tsc-references/classAppearsToHaveMembersOfObject.1.normal.js index 6967801176ea..e42d12e08267 100644 --- a/crates/swc/tests/tsc-references/classAppearsToHaveMembersOfObject.1.normal.js +++ b/crates/swc/tests/tsc-references/classAppearsToHaveMembersOfObject.1.normal.js @@ -6,6 +6,6 @@ var C = function C() { }; var c; var r = c.toString(); -var r2 = c.hasOwnProperty(""); +var r2 = c.hasOwnProperty(''); var o = c; var o2 = c; diff --git a/crates/swc/tests/tsc-references/classAppearsToHaveMembersOfObject.2.minified.js b/crates/swc/tests/tsc-references/classAppearsToHaveMembersOfObject.2.minified.js index dbd28e61e81b..e3fd77738c67 100644 --- a/crates/swc/tests/tsc-references/classAppearsToHaveMembersOfObject.2.minified.js +++ b/crates/swc/tests/tsc-references/classAppearsToHaveMembersOfObject.2.minified.js @@ -1,4 +1,4 @@ //// [classAppearsToHaveMembersOfObject.ts] var c; import "@swc/helpers/_/_class_call_check"; -c.toString(), c.hasOwnProperty(""); +c.toString(), c.hasOwnProperty(''); diff --git a/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.1.normal.js b/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.1.normal.js index 7710320eee4c..a350ad2f801c 100644 --- a/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.1.normal.js +++ b/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.1.normal.js @@ -91,7 +91,7 @@ var Conestoga = /*#__PURE__*/ function(Wagon1) { _class_call_check(this, Conestoga); var _this; // error: wrong type - _this = _super.call(this, "nope"); + _this = _super.call(this, 'nope'); _this.drunkOO = drunkOO; return _this; } diff --git a/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.2.minified.js b/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.2.minified.js index d056c9d2e2a3..e56b17338c60 100644 --- a/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.2.minified.js +++ b/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.2.minified.js @@ -36,7 +36,7 @@ var c = new (function(Wagon1) { var _super = _create_super(Conestoga); function Conestoga(drunkOO) { var _this; - return _class_call_check(this, Conestoga), (_this = _super.call(this, "nope")).drunkOO = drunkOO, _this; + return _class_call_check(this, Conestoga), (_this = _super.call(this, 'nope')).drunkOO = drunkOO, _this; } return Conestoga.circle = function(others) { return others.length; diff --git a/crates/swc/tests/tsc-references/classExtendingClass.1.normal.js b/crates/swc/tests/tsc-references/classExtendingClass.1.normal.js index 3273154f036f..29d274a729d1 100644 --- a/crates/swc/tests/tsc-references/classExtendingClass.1.normal.js +++ b/crates/swc/tests/tsc-references/classExtendingClass.1.normal.js @@ -50,5 +50,5 @@ var D2 = /*#__PURE__*/ function(C2) { var d2; var r5 = d2.foo; var r6 = d2.bar; -var r7 = d2.thing(""); +var r7 = d2.thing(''); var r8 = D2.other(1); diff --git a/crates/swc/tests/tsc-references/classExtendingClass.2.minified.js b/crates/swc/tests/tsc-references/classExtendingClass.2.minified.js index 3cb1f428f5ca..58f511a15ef6 100644 --- a/crates/swc/tests/tsc-references/classExtendingClass.2.minified.js +++ b/crates/swc/tests/tsc-references/classExtendingClass.2.minified.js @@ -29,4 +29,4 @@ var D2 = function(C2) { } return C2.prototype.thing = function(x) {}, C2.other = function(x) {}, C2; }()); -d2.foo, d2.bar, d2.thing(""), D2.other(1); +d2.foo, d2.bar, d2.thing(''), D2.other(1); diff --git a/crates/swc/tests/tsc-references/classWithConstructors.1.normal.js b/crates/swc/tests/tsc-references/classWithConstructors.1.normal.js index 72d8064018a9..112eee77881a 100644 --- a/crates/swc/tests/tsc-references/classWithConstructors.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithConstructors.1.normal.js @@ -9,13 +9,13 @@ var NonGeneric; _class_call_check(this, C); }; var c = new C(); // error - var c2 = new C(""); // ok + var c2 = new C(''); // ok var C2 = function C2(x) { "use strict"; _class_call_check(this, C2); }; var c3 = new C2(); // error - var c4 = new C2(""); // ok + var c4 = new C2(''); // ok var c5 = new C2(1); // ok var D = /*#__PURE__*/ function(C2) { "use strict"; @@ -29,7 +29,7 @@ var NonGeneric; }(C2); var d = new D(); // error var d2 = new D(1); // ok - var d3 = new D(""); // ok + var d3 = new D(''); // ok })(NonGeneric || (NonGeneric = {})); var Generics; (function(Generics) { @@ -38,13 +38,13 @@ var Generics; _class_call_check(this, C); }; var c = new C(); // error - var c2 = new C(""); // ok + var c2 = new C(''); // ok var C2 = function C2(x) { "use strict"; _class_call_check(this, C2); }; var c3 = new C2(); // error - var c4 = new C2(""); // ok + var c4 = new C2(''); // ok var c5 = new C2(1, 2); // ok var D = /*#__PURE__*/ function(C2) { "use strict"; @@ -58,5 +58,5 @@ var Generics; }(C2); var d = new D(); // error var d2 = new D(1); // ok - var d3 = new D(""); // ok + var d3 = new D(''); // ok })(Generics || (Generics = {})); diff --git a/crates/swc/tests/tsc-references/classWithConstructors.2.minified.js b/crates/swc/tests/tsc-references/classWithConstructors.2.minified.js index 8276a916a18c..416cb7392c10 100644 --- a/crates/swc/tests/tsc-references/classWithConstructors.2.minified.js +++ b/crates/swc/tests/tsc-references/classWithConstructors.2.minified.js @@ -5,24 +5,24 @@ import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; NonGeneric || (NonGeneric = {}), new (C = function C(x) { _class_call_check(this, C); -})(), new C(""), new (C2 = function C2(x) { +})(), new C(''), new (C2 = function C2(x) { _class_call_check(this, C2); -})(), new C2(""), new C2(1), new (D = function(C2) { +})(), new C2(''), new C2(1), new (D = function(C2) { _inherits(D, C2); var _super = _create_super(D); function D() { return _class_call_check(this, D), _super.apply(this, arguments); } return D; -}(C2))(), new D(1), new D(""), Generics || (Generics = {}), new (C1 = function C(x) { +}(C2))(), new D(1), new D(''), Generics || (Generics = {}), new (C1 = function C(x) { _class_call_check(this, C); -})(), new C1(""), new (C21 = function C2(x) { +})(), new C1(''), new (C21 = function C2(x) { _class_call_check(this, C2); -})(), new C21(""), new C21(1, 2), new (D1 = function(C2) { +})(), new C21(''), new C21(1, 2), new (D1 = function(C2) { _inherits(D, C2); var _super = _create_super(D); function D() { return _class_call_check(this, D), _super.apply(this, arguments); } return D; -}(C21))(), new D1(1), new D1(""); +}(C21))(), new D1(1), new D1(''); diff --git a/crates/swc/tests/tsc-references/classWithEmptyBody.1.normal.js b/crates/swc/tests/tsc-references/classWithEmptyBody.1.normal.js index bbc178ccd7c3..e3a067a7c430 100644 --- a/crates/swc/tests/tsc-references/classWithEmptyBody.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithEmptyBody.1.normal.js @@ -8,7 +8,7 @@ var c; var o = c; c = 1; c = { - foo: "" + foo: '' }; c = function() {}; var D = function D() { @@ -20,6 +20,6 @@ var d; var o = d; d = 1; d = { - foo: "" + foo: '' }; d = function() {}; diff --git a/crates/swc/tests/tsc-references/classWithPrivateProperty.1.normal.js b/crates/swc/tests/tsc-references/classWithPrivateProperty.1.normal.js index 9cb9043d45e1..35b2546fc9a6 100644 --- a/crates/swc/tests/tsc-references/classWithPrivateProperty.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithPrivateProperty.1.normal.js @@ -5,23 +5,23 @@ var C = /*#__PURE__*/ function() { "use strict"; function C() { _class_call_check(this, C); - this.a = ""; - this.b = ""; + this.a = ''; + this.b = ''; this.d = function() { - return ""; + return ''; }; } var _proto = C.prototype; _proto.c = function c() { - return ""; + return ''; }; C.f = function f() { - return ""; + return ''; }; return C; }(); C.g = function() { - return ""; + return ''; }; var c = new C(); var r1 = c.x; diff --git a/crates/swc/tests/tsc-references/classWithPrivateProperty.2.minified.js b/crates/swc/tests/tsc-references/classWithPrivateProperty.2.minified.js index 9f2f78d91420..f8df8214897c 100644 --- a/crates/swc/tests/tsc-references/classWithPrivateProperty.2.minified.js +++ b/crates/swc/tests/tsc-references/classWithPrivateProperty.2.minified.js @@ -2,18 +2,18 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var C = function() { function C() { - _class_call_check(this, C), this.a = "", this.b = "", this.d = function() { - return ""; + _class_call_check(this, C), this.a = '', this.b = '', this.d = function() { + return ''; }; } return C.prototype.c = function() { - return ""; + return ''; }, C.f = function() { - return ""; + return ''; }, C; }(); C.g = function() { - return ""; + return ''; }; var c = new C(); c.x, c.a, c.b, c.c(), c.d(), C.e, C.f(), C.g(); diff --git a/crates/swc/tests/tsc-references/classWithProtectedProperty.1.normal.js b/crates/swc/tests/tsc-references/classWithProtectedProperty.1.normal.js index a836050dbc38..a1f4e4919804 100644 --- a/crates/swc/tests/tsc-references/classWithProtectedProperty.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithProtectedProperty.1.normal.js @@ -7,23 +7,23 @@ var C = /*#__PURE__*/ function() { "use strict"; function C() { _class_call_check(this, C); - this.a = ""; - this.b = ""; + this.a = ''; + this.b = ''; this.d = function() { - return ""; + return ''; }; } var _proto = C.prototype; _proto.c = function c() { - return ""; + return ''; }; C.f = function f() { - return ""; + return ''; }; return C; }(); C.g = function() { - return ""; + return ''; }; var D = /*#__PURE__*/ function(C1) { "use strict"; diff --git a/crates/swc/tests/tsc-references/classWithProtectedProperty.2.minified.js b/crates/swc/tests/tsc-references/classWithProtectedProperty.2.minified.js index 60495a5d3561..2e95e3b3f6e4 100644 --- a/crates/swc/tests/tsc-references/classWithProtectedProperty.2.minified.js +++ b/crates/swc/tests/tsc-references/classWithProtectedProperty.2.minified.js @@ -4,15 +4,15 @@ import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; (function() { function C() { - _class_call_check(this, C), this.a = "", this.b = "", this.d = function() { - return ""; + _class_call_check(this, C), this.a = '', this.b = '', this.d = function() { + return ''; }; } return C.prototype.c = function() { - return ""; + return ''; }, C.f = function() { - return ""; + return ''; }, C; })().g = function() { - return ""; + return ''; }; diff --git a/crates/swc/tests/tsc-references/classWithPublicProperty.1.normal.js b/crates/swc/tests/tsc-references/classWithPublicProperty.1.normal.js index 5a71b1579eaf..d162c58f2fd2 100644 --- a/crates/swc/tests/tsc-references/classWithPublicProperty.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithPublicProperty.1.normal.js @@ -4,23 +4,23 @@ var C = /*#__PURE__*/ function() { "use strict"; function C() { _class_call_check(this, C); - this.a = ""; - this.b = ""; + this.a = ''; + this.b = ''; this.d = function() { - return ""; + return ''; }; } var _proto = C.prototype; _proto.c = function c() { - return ""; + return ''; }; C.f = function f() { - return ""; + return ''; }; return C; }(); C.g = function() { - return ""; + return ''; }; // all of these are valid var c = new C(); diff --git a/crates/swc/tests/tsc-references/classWithPublicProperty.2.minified.js b/crates/swc/tests/tsc-references/classWithPublicProperty.2.minified.js index 45f3c0520bf3..876b839a1c2a 100644 --- a/crates/swc/tests/tsc-references/classWithPublicProperty.2.minified.js +++ b/crates/swc/tests/tsc-references/classWithPublicProperty.2.minified.js @@ -2,18 +2,18 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var C = function() { function C() { - _class_call_check(this, C), this.a = "", this.b = "", this.d = function() { - return ""; + _class_call_check(this, C), this.a = '', this.b = '', this.d = function() { + return ''; }; } return C.prototype.c = function() { - return ""; + return ''; }, C.f = function() { - return ""; + return ''; }, C; }(); C.g = function() { - return ""; + return ''; }; var c = new C(); c.x, c.a, c.b, c.c(), c.d(), C.e, C.f(), C.g(); diff --git a/crates/swc/tests/tsc-references/classWithoutExplicitConstructor.1.normal.js b/crates/swc/tests/tsc-references/classWithoutExplicitConstructor.1.normal.js index e9ee2de89408..10314c163d81 100644 --- a/crates/swc/tests/tsc-references/classWithoutExplicitConstructor.1.normal.js +++ b/crates/swc/tests/tsc-references/classWithoutExplicitConstructor.1.normal.js @@ -4,7 +4,7 @@ var C = function C() { "use strict"; _class_call_check(this, C); this.x = 1; - this.y = "hello"; + this.y = 'hello'; }; var c = new C(); var c2 = new C(null); // error diff --git a/crates/swc/tests/tsc-references/classWithoutExplicitConstructor.2.minified.js b/crates/swc/tests/tsc-references/classWithoutExplicitConstructor.2.minified.js index dd3a38b11ff2..31b889a33ad9 100644 --- a/crates/swc/tests/tsc-references/classWithoutExplicitConstructor.2.minified.js +++ b/crates/swc/tests/tsc-references/classWithoutExplicitConstructor.2.minified.js @@ -1,7 +1,7 @@ //// [classWithoutExplicitConstructor.ts] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var C = function C() { - _class_call_check(this, C), this.x = 1, this.y = "hello"; + _class_call_check(this, C), this.x = 1, this.y = 'hello'; }; new C(), new C(null); var D = function D() { diff --git a/crates/swc/tests/tsc-references/commonJSAliasedExport.1.normal.js b/crates/swc/tests/tsc-references/commonJSAliasedExport.1.normal.js index 5402a4c6db15..087fd273ce8a 100644 --- a/crates/swc/tests/tsc-references/commonJSAliasedExport.1.normal.js +++ b/crates/swc/tests/tsc-references/commonJSAliasedExport.1.normal.js @@ -8,6 +8,6 @@ function funky(declaration) { module.exports = donkey; module.exports.funky = funky; //// [bug43713.js] -var funky = require("./commonJSAliasedExport").funky; +var funky = require('./commonJSAliasedExport').funky; /** @type {boolean} */ var diddy; var diddy = funky(1); diff --git a/crates/swc/tests/tsc-references/commonJSAliasedExport.2.minified.js b/crates/swc/tests/tsc-references/commonJSAliasedExport.2.minified.js index 0ad837853c9d..025d950961eb 100644 --- a/crates/swc/tests/tsc-references/commonJSAliasedExport.2.minified.js +++ b/crates/swc/tests/tsc-references/commonJSAliasedExport.2.minified.js @@ -5,4 +5,4 @@ module.exports = function(ast) { return !1; }; //// [bug43713.js] -(0, require("./commonJSAliasedExport").funky)(1); +(0, require('./commonJSAliasedExport').funky)(1); diff --git a/crates/swc/tests/tsc-references/commonJSReexport.1.normal.js b/crates/swc/tests/tsc-references/commonJSReexport.1.normal.js index a7b404a7e508..a0daa434b809 100644 --- a/crates/swc/tests/tsc-references/commonJSReexport.1.normal.js +++ b/crates/swc/tests/tsc-references/commonJSReexport.1.normal.js @@ -9,8 +9,8 @@ module.exports = { }; //// [second.js] module.exports = { - nested: require("./first") + nested: require('./first') }; //// [main.js] -var hardline = require("./second").nested.hardline; +var hardline = require('./second').nested.hardline; hardline; diff --git a/crates/swc/tests/tsc-references/commonJSReexport.2.minified.js b/crates/swc/tests/tsc-references/commonJSReexport.2.minified.js index bef5632e625f..ce03f2b20790 100644 --- a/crates/swc/tests/tsc-references/commonJSReexport.2.minified.js +++ b/crates/swc/tests/tsc-references/commonJSReexport.2.minified.js @@ -7,7 +7,7 @@ module.exports = { }; //// [second.js] module.exports = { - nested: require("./first") + nested: require('./first') }; //// [main.js] -require("./second").nested.hardline; +require('./second').nested.hardline; diff --git a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned.1.normal.js b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned.1.normal.js index caa63baf87b5..5d7eb3e950bf 100644 --- a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned.1.normal.js +++ b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCanBeAssigned.1.normal.js @@ -11,7 +11,7 @@ x1 += a; x1 += b; x1 += true; x1 += 0; -x1 += ""; +x1 += ''; x1 += 0; x1 += {}; x1 += null; @@ -21,7 +21,7 @@ x2 += a; x2 += b; x2 += true; x2 += 0; -x2 += ""; +x2 += ''; x2 += 0; x2 += {}; x2 += null; @@ -42,6 +42,6 @@ var x5; x5 += a; var x6; x6 += a; -x6 += ""; +x6 += ''; var x7; x7 += a; diff --git a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned.1.normal.js b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned.1.normal.js index c545793fb251..8f3cec1c7596 100644 --- a/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned.1.normal.js +++ b/crates/swc/tests/tsc-references/compoundAdditionAssignmentLHSCannotBeAssigned.1.normal.js @@ -7,12 +7,12 @@ var E; E[E["c"] = 2] = "c"; })(E || (E = {})); var x1; -x1 += ""; +x1 += ''; var x2; -x2 += ""; +x2 += ''; var x3; -x3 += ""; +x3 += ''; var x4; -x4 += ""; +x4 += ''; var x5; -x5 += ""; +x5 += ''; diff --git a/crates/swc/tests/tsc-references/compoundAssignmentLHSIsReference.1.normal.js b/crates/swc/tests/tsc-references/compoundAssignmentLHSIsReference.1.normal.js index 6605a7668080..dbec746ffb48 100644 --- a/crates/swc/tests/tsc-references/compoundAssignmentLHSIsReference.1.normal.js +++ b/crates/swc/tests/tsc-references/compoundAssignmentLHSIsReference.1.normal.js @@ -12,8 +12,8 @@ function fn1(x2) { var x3; x3.a *= value; x3.a += value; -x3["a"] *= value; -x3["a"] += value; +x3['a'] *= value; +x3['a'] += value; // parentheses, the contained expression is reference x1 *= value; x1 += value; @@ -23,5 +23,5 @@ function fn2(x4) { } x3.a *= value; x3.a += value; -x3["a"] *= value; -x3["a"] += value; +x3['a'] *= value; +x3['a'] += value; diff --git a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSIsReference.1.normal.js b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSIsReference.1.normal.js index 39062303ee06..b5635beea28d 100644 --- a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSIsReference.1.normal.js +++ b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSIsReference.1.normal.js @@ -10,8 +10,8 @@ function fn1(x2) { var x3; var ref = x3.a; x3.a = Math.pow(ref, value); -var ref1 = x3["a"]; -x3["a"] = Math.pow(ref1, value); +var ref1 = x3['a']; +x3['a'] = Math.pow(ref1, value); // parentheses, the contained expression is reference x1 = Math.pow(x1, value); function fn2(x4) { @@ -19,5 +19,5 @@ function fn2(x4) { } var ref2 = x3.a; x3.a = Math.pow(ref2, value); -var ref3 = x3["a"]; -x3["a"] = Math.pow(ref3, value); +var ref3 = x3['a']; +x3['a'] = Math.pow(ref3, value); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames32_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames32_ES5.1.normal.js index 36336f80d601..4cb04df14b50 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames32_ES5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames32_ES5.1.normal.js @@ -1,7 +1,7 @@ //// [computedPropertyNames32_ES5.ts] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; function foo() { - return ""; + return ''; } var C = /*#__PURE__*/ function() { "use strict"; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames33_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames33_ES5.1.normal.js index 58e906ccdc22..55310d0ba8d7 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames33_ES5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames33_ES5.1.normal.js @@ -2,7 +2,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _define_property } from "@swc/helpers/_/_define_property"; function foo() { - return ""; + return ''; } var C = /*#__PURE__*/ function() { "use strict"; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames34_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames34_ES5.1.normal.js index 56a458cb227e..e84e0b88d69f 100644 --- a/crates/swc/tests/tsc-references/computedPropertyNames34_ES5.1.normal.js +++ b/crates/swc/tests/tsc-references/computedPropertyNames34_ES5.1.normal.js @@ -2,7 +2,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _define_property } from "@swc/helpers/_/_define_property"; function foo() { - return ""; + return ''; } var C = /*#__PURE__*/ function() { "use strict"; diff --git a/crates/swc/tests/tsc-references/conditionalOperatorConditoinIsStringType.1.normal.js b/crates/swc/tests/tsc-references/conditionalOperatorConditoinIsStringType.1.normal.js index 3e4e90d0005c..0a6c35083dc9 100644 --- a/crates/swc/tests/tsc-references/conditionalOperatorConditoinIsStringType.1.normal.js +++ b/crates/swc/tests/tsc-references/conditionalOperatorConditoinIsStringType.1.normal.js @@ -22,8 +22,8 @@ condString ? exprString1 : exprBoolean1; // union //Cond is a string type literal "" ? exprAny1 : exprAny2; "string" ? exprBoolean1 : exprBoolean2; -"c" ? exprNumber1 : exprNumber2; -"string" ? exprString1 : exprString2; +'c' ? exprNumber1 : exprNumber2; +'string' ? exprString1 : exprString2; " " ? exprIsObject1 : exprIsObject2; "hello " ? exprString1 : exprBoolean1; // union //Cond is a string type expression @@ -50,8 +50,8 @@ var resultIsObject1 = condString ? exprIsObject1 : exprIsObject2; var resultIsStringOrBoolean1 = condString ? exprString1 : exprBoolean1; // union var resultIsAny2 = "" ? exprAny1 : exprAny2; var resultIsBoolean2 = "string" ? exprBoolean1 : exprBoolean2; -var resultIsNumber2 = "c" ? exprNumber1 : exprNumber2; -var resultIsString2 = "string" ? exprString1 : exprString2; +var resultIsNumber2 = 'c' ? exprNumber1 : exprNumber2; +var resultIsString2 = 'string' ? exprString1 : exprString2; var resultIsObject2 = " " ? exprIsObject1 : exprIsObject2; var resultIsStringOrBoolean2 = "hello" ? exprString1 : exprBoolean1; // union var resultIsAny3 = (typeof condString === "undefined" ? "undefined" : _type_of(condString)) ? exprAny1 : exprAny2; diff --git a/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT.1.normal.js b/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT.1.normal.js index cf2d0b64e17c..ee5b2ac24ff4 100644 --- a/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT.1.normal.js +++ b/crates/swc/tests/tsc-references/conditionalOperatorWithIdenticalBCT.1.normal.js @@ -40,14 +40,14 @@ true ? { a: 1 } : { a: 2, - b: "string" + b: 'string' }; var result2 = true ? {} : 1; var result3 = true ? { a: 1 } : { a: 2, - b: "string" + b: 'string' }; //Contextually typed var resultIsX1 = true ? x : a; @@ -64,14 +64,14 @@ var result5 = true ? a : x; true ? 1 : {}; true ? { a: 2, - b: "string" + b: 'string' } : { a: 1 }; var result6 = true ? 1 : {}; var result7 = true ? { a: 2, - b: "string" + b: 'string' } : { a: 1 }; @@ -91,4 +91,4 @@ var result10 = true ? function(m) { return n.propertyX2; }; //Expr1 and Expr2 are literals -var result11 = true ? 1 : "string"; +var result11 = true ? 1 : 'string'; diff --git a/crates/swc/tests/tsc-references/conditionalTypes1.1.normal.js b/crates/swc/tests/tsc-references/conditionalTypes1.1.normal.js index c3f2d29d5f45..1c824a5fc2d1 100644 --- a/crates/swc/tests/tsc-references/conditionalTypes1.1.normal.js +++ b/crates/swc/tests/tsc-references/conditionalTypes1.1.normal.js @@ -112,7 +112,7 @@ var a = { c: [ { a: 1, - c: "213" + c: '213' } ] }; @@ -121,7 +121,7 @@ assign(a, { c: { 0: { a: 2, - c: "213123" + c: '213123' } } }); diff --git a/crates/swc/tests/tsc-references/conditionalTypes1.2.minified.js b/crates/swc/tests/tsc-references/conditionalTypes1.2.minified.js index 6c879f5fb3a7..f58966b70045 100644 --- a/crates/swc/tests/tsc-references/conditionalTypes1.2.minified.js +++ b/crates/swc/tests/tsc-references/conditionalTypes1.2.minified.js @@ -5,7 +5,7 @@ f5("a"), assign({ c: [ { a: 1, - c: "213" + c: '213' } ] }, { @@ -13,7 +13,7 @@ f5("a"), assign({ c: { 0: { a: 2, - c: "213123" + c: '213123' } } }); diff --git a/crates/swc/tests/tsc-references/conditionalTypesExcessProperties.1.normal.js b/crates/swc/tests/tsc-references/conditionalTypesExcessProperties.1.normal.js index 3e10c5cdfbaa..07cbcd04ea26 100644 --- a/crates/swc/tests/tsc-references/conditionalTypesExcessProperties.1.normal.js +++ b/crates/swc/tests/tsc-references/conditionalTypesExcessProperties.1.normal.js @@ -1,11 +1,11 @@ //// [conditionalTypesExcessProperties.ts] function testFunc2(a, sa) { sa = { - test: "hi", + test: 'hi', arg: a }; // not excess (but currently still not assignable) sa = { - test: "bye", + test: 'bye', arg: a, arr: a } // excess diff --git a/crates/swc/tests/tsc-references/conflictingCommonJSES2015Exports.1.normal.js b/crates/swc/tests/tsc-references/conflictingCommonJSES2015Exports.1.normal.js index b991c70ff8ae..764c92546d25 100644 --- a/crates/swc/tests/tsc-references/conflictingCommonJSES2015Exports.1.normal.js +++ b/crates/swc/tests/tsc-references/conflictingCommonJSES2015Exports.1.normal.js @@ -6,5 +6,5 @@ module.exports = { abc: abc }; //// [use.js] -import { abc } from "./bug24934"; +import { abc } from './bug24934'; abc(1, 2, 3); diff --git a/crates/swc/tests/tsc-references/conflictingCommonJSES2015Exports.2.minified.js b/crates/swc/tests/tsc-references/conflictingCommonJSES2015Exports.2.minified.js index b991c70ff8ae..764c92546d25 100644 --- a/crates/swc/tests/tsc-references/conflictingCommonJSES2015Exports.2.minified.js +++ b/crates/swc/tests/tsc-references/conflictingCommonJSES2015Exports.2.minified.js @@ -6,5 +6,5 @@ module.exports = { abc: abc }; //// [use.js] -import { abc } from "./bug24934"; +import { abc } from './bug24934'; abc(1, 2, 3); diff --git a/crates/swc/tests/tsc-references/constEnum3.1.normal.js b/crates/swc/tests/tsc-references/constEnum3.1.normal.js index d00b04299cbc..f7746af99e7d 100644 --- a/crates/swc/tests/tsc-references/constEnum3.1.normal.js +++ b/crates/swc/tests/tsc-references/constEnum3.1.normal.js @@ -4,5 +4,5 @@ function f1(f) {} function f2(f) {} f1(0); f1(1); -f2("foo"); -f2("bar"); +f2('foo'); +f2('bar'); diff --git a/crates/swc/tests/tsc-references/constructSignaturesWithIdenticalOverloads.1.normal.js b/crates/swc/tests/tsc-references/constructSignaturesWithIdenticalOverloads.1.normal.js index f99d85592a04..9e31c81b18a9 100644 --- a/crates/swc/tests/tsc-references/constructSignaturesWithIdenticalOverloads.1.normal.js +++ b/crates/swc/tests/tsc-references/constructSignaturesWithIdenticalOverloads.1.normal.js @@ -5,17 +5,17 @@ var C = function C(x) { "use strict"; _class_call_check(this, C); }; -var r1 = new C(1, ""); +var r1 = new C(1, ''); var C2 = function C2(x) { "use strict"; _class_call_check(this, C2); }; -var r2 = new C2(1, ""); +var r2 = new C2(1, ''); var i; -var r3 = new i(1, ""); +var r3 = new i(1, ''); var i2; -var r4 = new i2(1, ""); +var r4 = new i2(1, ''); var a; -var r5 = new a(1, ""); +var r5 = new a(1, ''); var b; -var r6 = new b(1, ""); +var r6 = new b(1, ''); diff --git a/crates/swc/tests/tsc-references/constructSignaturesWithIdenticalOverloads.2.minified.js b/crates/swc/tests/tsc-references/constructSignaturesWithIdenticalOverloads.2.minified.js index 529265ace8b5..b5616841bfc1 100644 --- a/crates/swc/tests/tsc-references/constructSignaturesWithIdenticalOverloads.2.minified.js +++ b/crates/swc/tests/tsc-references/constructSignaturesWithIdenticalOverloads.2.minified.js @@ -3,6 +3,6 @@ var i, i2, a, b; import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; new function C(x) { _class_call_check(this, C); -}(1, ""), new function C2(x) { +}(1, ''), new function C2(x) { _class_call_check(this, C2); -}(1, ""), new i(1, ""), new i2(1, ""), new a(1, ""), new b(1, ""); +}(1, ''), new i(1, ''), new i2(1, ''), new a(1, ''), new b(1, ''); diff --git a/crates/swc/tests/tsc-references/constructSignaturesWithOverloads.1.normal.js b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads.1.normal.js index 960b8de0e3f7..5f12c8abceb0 100644 --- a/crates/swc/tests/tsc-references/constructSignaturesWithOverloads.1.normal.js +++ b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads.1.normal.js @@ -5,17 +5,17 @@ var C = function C(x) { "use strict"; _class_call_check(this, C); }; -var r1 = new C(1, ""); +var r1 = new C(1, ''); var C2 = function C2(x) { "use strict"; _class_call_check(this, C2); }; -var r2 = new C2(1, ""); +var r2 = new C2(1, ''); var i; -var r3 = new i(1, ""); +var r3 = new i(1, ''); var i2; -var r4 = new i2(1, ""); +var r4 = new i2(1, ''); var a; -var r5 = new a(1, ""); +var r5 = new a(1, ''); var b; -var r6 = new b(1, ""); +var r6 = new b(1, ''); diff --git a/crates/swc/tests/tsc-references/constructSignaturesWithOverloads.2.minified.js b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads.2.minified.js index 70db1c64902d..7b7cbe8a737d 100644 --- a/crates/swc/tests/tsc-references/constructSignaturesWithOverloads.2.minified.js +++ b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads.2.minified.js @@ -3,6 +3,6 @@ var i, i2, a, b; import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; new function C(x) { _class_call_check(this, C); -}(1, ""), new function C2(x) { +}(1, ''), new function C2(x) { _class_call_check(this, C2); -}(1, ""), new i(1, ""), new i2(1, ""), new a(1, ""), new b(1, ""); +}(1, ''), new i(1, ''), new i2(1, ''), new a(1, ''), new b(1, ''); diff --git a/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2.1.normal.js b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2.1.normal.js index 9670e9efd553..ab7cf4a9177b 100644 --- a/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2.1.normal.js +++ b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2.1.normal.js @@ -9,7 +9,7 @@ var C = function C(x) { (function(C) { C.x = 1; })(C || (C = {})); -var r1 = new C(1, ""); +var r1 = new C(1, ''); var C2 = function C2(x) { "use strict"; _class_call_check(this, C2); @@ -17,7 +17,7 @@ var C2 = function C2(x) { (function(C2) { C2.x = 1; })(C2 || (C2 = {})); -var r2 = new C2(1, ""); +var r2 = new C2(1, ''); var i2; -var r4 = new i2(1, ""); +var r4 = new i2(1, ''); var r5 = new i2(1, 1); diff --git a/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2.2.minified.js b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2.2.minified.js index a3e6405faa48..a23fd7fb177e 100644 --- a/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2.2.minified.js +++ b/crates/swc/tests/tsc-references/constructSignaturesWithOverloads2.2.minified.js @@ -3,8 +3,8 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var i2, C = function C(x) { _class_call_check(this, C); }; -(C || (C = {})).x = 1, new C(1, ""); +(C || (C = {})).x = 1, new C(1, ''); var C2 = function C2(x) { _class_call_check(this, C2); }; -(C2 || (C2 = {})).x = 1, new C2(1, ""), new i2(1, ""), new i2(1, 1); +(C2 || (C2 = {})).x = 1, new C2(1, ''), new i2(1, ''), new i2(1, 1); diff --git a/crates/swc/tests/tsc-references/constructorFunctionMethodTypeParameters.1.normal.js b/crates/swc/tests/tsc-references/constructorFunctionMethodTypeParameters.1.normal.js index 833edcb16d56..0614bc7c9829 100644 --- a/crates/swc/tests/tsc-references/constructorFunctionMethodTypeParameters.1.normal.js +++ b/crates/swc/tests/tsc-references/constructorFunctionMethodTypeParameters.1.normal.js @@ -21,6 +21,6 @@ Cls.prototype.nestedComment = /** */ function(t, u) { return t; }; -var c = new Cls("a"); -var s = c.topLevelComment("a", "b"); -var t = c.nestedComment("a", "b"); +var c = new Cls('a'); +var s = c.topLevelComment('a', 'b'); +var t = c.nestedComment('a', 'b'); diff --git a/crates/swc/tests/tsc-references/constructorFunctionMethodTypeParameters.2.minified.js b/crates/swc/tests/tsc-references/constructorFunctionMethodTypeParameters.2.minified.js index 8adfba6d3dfc..300c02b2ed44 100644 --- a/crates/swc/tests/tsc-references/constructorFunctionMethodTypeParameters.2.minified.js +++ b/crates/swc/tests/tsc-references/constructorFunctionMethodTypeParameters.2.minified.js @@ -7,5 +7,5 @@ Cls.prototype.topLevelComment = function(t, v) { }, Cls.prototype.nestedComment = function(t, u) { return t; }; -var c = new Cls("a"); -c.topLevelComment("a", "b"), c.nestedComment("a", "b"); +var c = new Cls('a'); +c.topLevelComment('a', 'b'), c.nestedComment('a', 'b'); diff --git a/crates/swc/tests/tsc-references/constructorFunctions3.1.normal.js b/crates/swc/tests/tsc-references/constructorFunctions3.1.normal.js index 2cce49c215d2..a8963dc3732a 100644 --- a/crates/swc/tests/tsc-references/constructorFunctions3.1.normal.js +++ b/crates/swc/tests/tsc-references/constructorFunctions3.1.normal.js @@ -1,14 +1,14 @@ //// [a.js] function Instance() { - this.i = "simple"; + this.i = 'simple'; } var i = new Instance(); Instance; i; function StaticToo() { - this.i = "more complex"; + this.i = 'more complex'; } -StaticToo.property = "yep"; +StaticToo.property = 'yep'; var s = new StaticToo(); s; StaticToo; diff --git a/crates/swc/tests/tsc-references/constructorFunctions3.2.minified.js b/crates/swc/tests/tsc-references/constructorFunctions3.2.minified.js index 0f643b2dfd7a..f9569609be37 100644 --- a/crates/swc/tests/tsc-references/constructorFunctions3.2.minified.js +++ b/crates/swc/tests/tsc-references/constructorFunctions3.2.minified.js @@ -1,13 +1,13 @@ //// [a.js] function StaticToo() { - this.i = "more complex"; + this.i = 'more complex'; } function A() { this.x = 1, this.second = 1; } new function() { - this.i = "simple"; -}(), StaticToo.property = "yep", new StaticToo(), A.prototype.z = function(n) { + this.i = 'simple'; +}(), StaticToo.property = 'yep', new StaticToo(), A.prototype.z = function(n) { return n + this.x; }, A.t = function(m) { return m + 1; diff --git a/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment.1.normal.js b/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment.1.normal.js index a5ad172440cf..88f37990bbec 100644 --- a/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment.1.normal.js +++ b/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment.1.normal.js @@ -6,11 +6,11 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var ns = {}; /** @type {DoneStatus} */ ns.x = { - status: "done", + status: 'done', m: function m(n) {} }; ns.x = { - status: "done", + status: 'done', m: function m(n) {} }; ns.x; @@ -20,14 +20,14 @@ var Thing = /*#__PURE__*/ function() { function Thing() { _class_call_check(this, Thing); /** @type {DoneStatus} */ this.s = { - status: "done", + status: 'done', m: function m(n) {} }; } var _proto = Thing.prototype; _proto.fail = function fail() { this.s = { - status: "done", + status: 'done', m: function m(n) {} }; }; @@ -46,7 +46,7 @@ exports.x; module.exports.y; // prototype-property assignment /** @type {DoneStatus} */ Thing.prototype.x = { - status: "done", + status: 'done', m: function m(n) {} }; Thing.prototype.x; diff --git a/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment.2.minified.js b/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment.2.minified.js index fba11572dd21..b705ac07d76f 100644 --- a/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment.2.minified.js +++ b/crates/swc/tests/tsc-references/contextualTypedSpecialAssignment.2.minified.js @@ -2,22 +2,22 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var ns = {}; ns.x = { - status: "done", + status: 'done', m: function(n) {} }, ns.x = { - status: "done", + status: 'done', m: function(n) {} }, ns.x; var Thing = function() { function Thing() { _class_call_check(this, Thing), this.s = { - status: "done", + status: 'done', m: function(n) {} }; } return Thing.prototype.fail = function() { this.s = { - status: "done", + status: 'done', m: function(n) {} }; }, Thing; @@ -29,7 +29,7 @@ exports.x = { status: "done", m: function(n) {} }, module.exports.y, Thing.prototype.x = { - status: "done", + status: 'done', m: function(n) {} }, Thing.prototype.x; //// [mod.js] diff --git a/crates/swc/tests/tsc-references/contextuallyTypedIife.1.normal.js b/crates/swc/tests/tsc-references/contextuallyTypedIife.1.normal.js index fb14dc4490e7..1da36ac1463f 100644 --- a/crates/swc/tests/tsc-references/contextuallyTypedIife.1.normal.js +++ b/crates/swc/tests/tsc-references/contextuallyTypedIife.1.normal.js @@ -43,7 +43,7 @@ return mixed.every(function(n) { return !!n; }); -})(5, "oops", "oh no"); +})(5, 'oops', 'oh no'); (function() { for(var _len = arguments.length, noNumbers = new Array(_len), _key = 0; _key < _len; _key++){ noNumbers[_key] = arguments[_key]; diff --git a/crates/swc/tests/tsc-references/contextuallyTypedIife.2.minified.js b/crates/swc/tests/tsc-references/contextuallyTypedIife.2.minified.js index 55180b0f3c4c..b7d610e836f3 100644 --- a/crates/swc/tests/tsc-references/contextuallyTypedIife.2.minified.js +++ b/crates/swc/tests/tsc-references/contextuallyTypedIife.2.minified.js @@ -13,7 +13,7 @@ mixed.every(function(n) { return !!n; }); -}(5, "oops", "oh no"), function() { +}(5, 'oops', 'oh no'), function() { for(var _len = arguments.length, noNumbers = Array(_len), _key = 0; _key < _len; _key++)noNumbers[_key] = arguments[_key]; noNumbers.some(function(n) { return n > 0; diff --git a/crates/swc/tests/tsc-references/contextuallyTypedIifeStrict.1.normal.js b/crates/swc/tests/tsc-references/contextuallyTypedIifeStrict.1.normal.js index c252968533d4..c18c0b6a53c7 100644 --- a/crates/swc/tests/tsc-references/contextuallyTypedIifeStrict.1.normal.js +++ b/crates/swc/tests/tsc-references/contextuallyTypedIifeStrict.1.normal.js @@ -43,7 +43,7 @@ return mixed.every(function(n) { return !!n; }); -})(5, "oops", "oh no"); +})(5, 'oops', 'oh no'); (function() { for(var _len = arguments.length, noNumbers = new Array(_len), _key = 0; _key < _len; _key++){ noNumbers[_key] = arguments[_key]; diff --git a/crates/swc/tests/tsc-references/contextuallyTypedIifeStrict.2.minified.js b/crates/swc/tests/tsc-references/contextuallyTypedIifeStrict.2.minified.js index 11de5768920a..902e7ebfeda0 100644 --- a/crates/swc/tests/tsc-references/contextuallyTypedIifeStrict.2.minified.js +++ b/crates/swc/tests/tsc-references/contextuallyTypedIifeStrict.2.minified.js @@ -13,7 +13,7 @@ mixed.every(function(n) { return !!n; }); -}(5, "oops", "oh no"), function() { +}(5, 'oops', 'oh no'), function() { for(var _len = arguments.length, noNumbers = Array(_len), _key = 0; _key < _len; _key++)noNumbers[_key] = arguments[_key]; noNumbers.some(function(n) { return n > 0; diff --git a/crates/swc/tests/tsc-references/controlFlowAliasing.1.normal.js b/crates/swc/tests/tsc-references/controlFlowAliasing.1.normal.js index 02a46b1bc9d4..c84fe48859fa 100644 --- a/crates/swc/tests/tsc-references/controlFlowAliasing.1.normal.js +++ b/crates/swc/tests/tsc-references/controlFlowAliasing.1.normal.js @@ -39,13 +39,13 @@ function f14(x) { return notUndefined ? x : 0; } function f15(obj) { - var isString = typeof obj.x === "string"; + var isString = typeof obj.x === 'string'; if (isString) { var s = obj.x; } } function f16(obj) { - var isString = typeof obj.x === "string"; + var isString = typeof obj.x === 'string'; obj = { x: 42 }; @@ -54,13 +54,13 @@ function f16(obj) { } } function f17(obj) { - var isString = typeof obj[0] === "string"; + var isString = typeof obj[0] === 'string'; if (isString) { var s = obj[0]; } } function f18(obj) { - var isString = typeof obj[0] === "string"; + var isString = typeof obj[0] === 'string'; obj = [ 42 ]; @@ -69,7 +69,7 @@ function f18(obj) { } } function f20(obj) { - var isFoo = obj.kind === "foo"; + var isFoo = obj.kind === 'foo'; if (isFoo) { obj.foo; } else { @@ -77,7 +77,7 @@ function f20(obj) { } } function f21(obj) { - var isFoo = obj.kind === "foo"; + var isFoo = obj.kind === 'foo'; if (isFoo) { obj.foo; // Not narrowed because isFoo has type annotation } else { @@ -85,7 +85,7 @@ function f21(obj) { } } function f22(obj) { - var isFoo = obj.kind === "foo"; + var isFoo = obj.kind === 'foo'; if (isFoo) { obj.foo; // Not narrowed because isFoo is mutable } else { @@ -93,7 +93,7 @@ function f22(obj) { } } function f23(obj) { - var isFoo = obj.kind === "foo"; + var isFoo = obj.kind === 'foo'; obj = obj; if (isFoo) { obj.foo; // Not narrowed because obj is assigned in function body @@ -103,7 +103,7 @@ function f23(obj) { } function f24(arg) { var obj = arg; - var isFoo = obj.kind === "foo"; + var isFoo = obj.kind === 'foo'; if (isFoo) { obj.foo; } else { @@ -112,7 +112,7 @@ function f24(arg) { } function f25(arg) { var obj = arg; - var isFoo = obj.kind === "foo"; + var isFoo = obj.kind === 'foo'; if (isFoo) { obj.foo; } else { @@ -120,7 +120,7 @@ function f25(arg) { } } function f26(outer) { - var isFoo = outer.obj.kind === "foo"; + var isFoo = outer.obj.kind === 'foo'; if (isFoo) { outer.obj.foo; } else { @@ -128,7 +128,7 @@ function f26(outer) { } } function f27(outer) { - var isFoo = outer.obj.kind === "foo"; + var isFoo = outer.obj.kind === 'foo'; if (isFoo) { outer.obj.foo; // Not narrowed because obj is mutable } else { @@ -136,8 +136,8 @@ function f27(outer) { } } function f28(obj) { - var isFoo = obj && obj.kind === "foo"; - var isBar = obj && obj.kind === "bar"; + var isFoo = obj && obj.kind === 'foo'; + var isBar = obj && obj.kind === 'bar'; if (isFoo) { obj.foo; } @@ -148,7 +148,7 @@ function f28(obj) { // Narrowing by aliased discriminant property access function f30(obj) { var kind = obj.kind; - if (kind === "foo") { + if (kind === 'foo') { obj.foo; } else { obj.bar; @@ -156,7 +156,7 @@ function f30(obj) { } function f31(obj) { var kind = obj.kind; - if (kind === "foo") { + if (kind === 'foo') { obj.foo; } else { obj.bar; @@ -164,7 +164,7 @@ function f31(obj) { } function f32(obj) { var k = obj.kind; - if (k === "foo") { + if (k === 'foo') { obj.foo; } else { obj.bar; @@ -173,10 +173,10 @@ function f32(obj) { function f33(obj) { var kind = obj.kind; switch(kind){ - case "foo": + case 'foo': obj.foo; break; - case "bar": + case 'bar': obj.bar; break; } @@ -185,8 +185,8 @@ var C10 = function C10(x) { "use strict"; _class_call_check(this, C10); this.x = x; - var thisX_isString = typeof this.x === "string"; - var xIsString = typeof x === "string"; + var thisX_isString = typeof this.x === 'string'; + var xIsString = typeof x === 'string'; if (thisX_isString && xIsString) { var s; s = this.x; @@ -197,8 +197,8 @@ var C11 = function C11(x) { "use strict"; _class_call_check(this, C11); this.x = x; - var thisX_isString = typeof this.x === "string"; - var xIsString = typeof x === "string"; + var thisX_isString = typeof this.x === 'string'; + var xIsString = typeof x === 'string'; if (thisX_isString && xIsString) { // Some narrowings may be invalidated due to later assignments. var s; @@ -212,13 +212,13 @@ var C11 = function C11(x) { // Mixing of aliased discriminants and conditionals function f40(obj) { var kind = obj.kind; - var isFoo = kind == "foo"; + var isFoo = kind == 'foo'; if (isFoo && obj.foo) { var t = obj.foo; } } function gg2(obj) { - if (obj.kind === "str") { + if (obj.kind === 'str') { var t = obj.payload; } else { var t1 = obj.payload; @@ -226,7 +226,7 @@ function gg2(obj) { } function foo(param) { var kind = param.kind, payload = param.payload; - if (kind === "str") { + if (kind === 'str') { var t = payload; } else { var t1 = payload; diff --git a/crates/swc/tests/tsc-references/controlFlowAliasingCatchVariables.1.normal.js b/crates/swc/tests/tsc-references/controlFlowAliasingCatchVariables.1.normal.js index 2c813329fa20..993056fbd148 100644 --- a/crates/swc/tests/tsc-references/controlFlowAliasingCatchVariables.1.normal.js +++ b/crates/swc/tests/tsc-references/controlFlowAliasingCatchVariables.1.normal.js @@ -1,20 +1,20 @@ //// [controlFlowAliasingCatchVariables.ts] try {} catch (e) { - var isString = typeof e === "string"; + var isString = typeof e === 'string'; if (isString) { e.toUpperCase(); // e string } - if (typeof e === "string") { + if (typeof e === 'string') { e.toUpperCase(); // e string } } try {} catch (e) { - var isString1 = typeof e === "string"; + var isString1 = typeof e === 'string'; e = 1; if (isString1) { e.toUpperCase(); // e any/unknown } - if (typeof e === "string") { + if (typeof e === 'string') { e.toUpperCase(); // e string } } diff --git a/crates/swc/tests/tsc-references/controlFlowBindingElement.1.normal.js b/crates/swc/tests/tsc-references/controlFlowBindingElement.1.normal.js index 02bd4c9b9632..7480ae1a83d8 100644 --- a/crates/swc/tests/tsc-references/controlFlowBindingElement.1.normal.js +++ b/crates/swc/tests/tsc-references/controlFlowBindingElement.1.normal.js @@ -1,24 +1,24 @@ //// [controlFlowBindingElement.ts] { var data = { - param: "value" + param: 'value' }; var _data_param = data.param, param = _data_param === void 0 ? function() { - throw new Error("param is not defined"); + throw new Error('param is not defined'); }() : _data_param; console.log(param); // should not trigger 'Unreachable code detected.' }{ var data1 = { - param: "value" + param: 'value' }; var foo = ""; var _data_param1 = data1.param, param1 = _data_param1 === void 0 ? function() { - throw new Error("param is not defined"); + throw new Error('param is not defined'); }() : _data_param1; foo; // should be string }{ var data2 = { - param: "value" + param: 'value' }; var foo1 = ""; var _data_param2 = data2.param, param2 = _data_param2 === void 0 ? function() { @@ -27,7 +27,7 @@ foo1; // should be string | undefined }{ var data3 = { - param: "value" + param: 'value' }; var foo2 = ""; var _data_param3 = data3.param, param3 = _data_param3 === void 0 ? function() { @@ -40,9 +40,9 @@ window.window = window; var _window_ = window[function() { foo3 = ""; - return "window"; + return 'window'; }()], bar = _window_[function() { - return "window"; + return 'window'; }()]; foo3; // should be string }{ @@ -50,10 +50,10 @@ var window1 = {}; window1.window = window1; var _window_1 = window1[function() { - return "window"; + return 'window'; }()], bar1 = _window_1[function() { foo4 = ""; - return "window"; + return 'window'; }()]; foo4; // should be string }{ @@ -61,9 +61,9 @@ var window2 = {}; window2.window = window2; var _window_2 = window2[function() { - return "window"; + return 'window'; }()], tmp = _window_2[function() { - return "window"; + return 'window'; }()], bar2 = tmp === void 0 ? function() { foo5 = ""; return window2; diff --git a/crates/swc/tests/tsc-references/controlFlowBindingElement.2.minified.js b/crates/swc/tests/tsc-references/controlFlowBindingElement.2.minified.js index 6195e8b04412..b8309fba4a92 100644 --- a/crates/swc/tests/tsc-references/controlFlowBindingElement.2.minified.js +++ b/crates/swc/tests/tsc-references/controlFlowBindingElement.2.minified.js @@ -1,7 +1,7 @@ //// [controlFlowBindingElement.ts] -var _data_param = "value"; +var _data_param = 'value'; console.log(void 0 === _data_param ? function() { - throw Error("param is not defined"); + throw Error('param is not defined'); }() : _data_param); var window = {}; window.window = window, window.window.window; diff --git a/crates/swc/tests/tsc-references/controlFlowElementAccess.1.normal.js b/crates/swc/tests/tsc-references/controlFlowElementAccess.1.normal.js index 082bae52fa1a..fb1455c50a32 100644 --- a/crates/swc/tests/tsc-references/controlFlowElementAccess.1.normal.js +++ b/crates/swc/tests/tsc-references/controlFlowElementAccess.1.normal.js @@ -2,8 +2,8 @@ var x = { o: false }; -if (x["o"] === false) { - x["o"] = true; +if (x['o'] === false) { + x['o'] = true; } var y = [ 0, diff --git a/crates/swc/tests/tsc-references/controlFlowElementAccess2.1.normal.js b/crates/swc/tests/tsc-references/controlFlowElementAccess2.1.normal.js index bb95fdbc9bdf..552686e6be54 100644 --- a/crates/swc/tests/tsc-references/controlFlowElementAccess2.1.normal.js +++ b/crates/swc/tests/tsc-references/controlFlowElementAccess2.1.normal.js @@ -1,9 +1,9 @@ //// [controlFlowElementAccess2.ts] -if (typeof config["works"] !== "boolean") { - config.works.prop = "test"; // ok - config["works"].prop = "test"; // error, config['works']: boolean | { 'prop': string } +if (typeof config['works'] !== 'boolean') { + config.works.prop = 'test'; // ok + config['works'].prop = 'test'; // error, config['works']: boolean | { 'prop': string } } -if (typeof config.works !== "boolean") { - config["works"].prop = "test"; // error, config['works']: boolean | { 'prop': string } - config.works.prop = "test"; // ok +if (typeof config.works !== 'boolean') { + config['works'].prop = 'test'; // error, config['works']: boolean | { 'prop': string } + config.works.prop = 'test'; // ok } diff --git a/crates/swc/tests/tsc-references/controlFlowElementAccess2.2.minified.js b/crates/swc/tests/tsc-references/controlFlowElementAccess2.2.minified.js index d3b7e0a6ffa2..8df958c4a72a 100644 --- a/crates/swc/tests/tsc-references/controlFlowElementAccess2.2.minified.js +++ b/crates/swc/tests/tsc-references/controlFlowElementAccess2.2.minified.js @@ -1,2 +1,2 @@ //// [controlFlowElementAccess2.ts] -"boolean" != typeof config.works && (config.works.prop = "test", config.works.prop = "test"), "boolean" != typeof config.works && (config.works.prop = "test", config.works.prop = "test"); +'boolean' != typeof config.works && (config.works.prop = 'test', config.works.prop = 'test'), 'boolean' != typeof config.works && (config.works.prop = 'test', config.works.prop = 'test'); diff --git a/crates/swc/tests/tsc-references/controlFlowForInStatement2.1.normal.js b/crates/swc/tests/tsc-references/controlFlowForInStatement2.1.normal.js index c5f98670b6a9..10741788073e 100644 --- a/crates/swc/tests/tsc-references/controlFlowForInStatement2.1.normal.js +++ b/crates/swc/tests/tsc-references/controlFlowForInStatement2.1.normal.js @@ -1,13 +1,13 @@ //// [controlFlowForInStatement2.ts] -var keywordA = "a"; -var keywordB = "b"; -if ("a" in c) { +var keywordA = 'a'; +var keywordB = 'b'; +if ('a' in c) { c; // narrowed to `A` } if (keywordA in c) { c; // also narrowed to `A` } -var stringB = "b"; +var stringB = 'b'; if (stringB in c) { c; // narrowed to `B` } diff --git a/crates/swc/tests/tsc-references/controlFlowForInStatement2.2.minified.js b/crates/swc/tests/tsc-references/controlFlowForInStatement2.2.minified.js index 7bc2691ef7d2..4729c48f0b54 100644 --- a/crates/swc/tests/tsc-references/controlFlowForInStatement2.2.minified.js +++ b/crates/swc/tests/tsc-references/controlFlowForInStatement2.2.minified.js @@ -1,2 +1,2 @@ //// [controlFlowForInStatement2.ts] -"a" in c && c, "a" in c && c, "b" in c && c, "b" in c && c; +'a' in c && c, 'a' in c && c, 'b' in c && c, 'b' in c && c; diff --git a/crates/swc/tests/tsc-references/controlFlowGenericTypes.1.normal.js b/crates/swc/tests/tsc-references/controlFlowGenericTypes.1.normal.js index cd09255a3b9e..7ba27d5caf73 100644 --- a/crates/swc/tests/tsc-references/controlFlowGenericTypes.1.normal.js +++ b/crates/swc/tests/tsc-references/controlFlowGenericTypes.1.normal.js @@ -45,7 +45,7 @@ function g4(x) { } } export function bounceAndTakeIfA(value) { - if (value === "A") { + if (value === 'A') { takeA(value); return value; } else { @@ -54,19 +54,19 @@ export function bounceAndTakeIfA(value) { } var fn = function(value) { value.foo; // Error - if ("foo" in value) { + if ('foo' in value) { value.foo; } - if (value.tag === "B") { + if (value.tag === 'B') { value.foo; } }; var fn2 = function(value) { value.foo; // Error - if ("foo" in value) { + if ('foo' in value) { value.foo; } - if (value.tag === "B") { + if (value.tag === 'B') { value.foo; } }; diff --git a/crates/swc/tests/tsc-references/controlFlowGenericTypes.2.minified.js b/crates/swc/tests/tsc-references/controlFlowGenericTypes.2.minified.js index 7289fb29be09..428e2111a2bc 100644 --- a/crates/swc/tests/tsc-references/controlFlowGenericTypes.2.minified.js +++ b/crates/swc/tests/tsc-references/controlFlowGenericTypes.2.minified.js @@ -1,5 +1,5 @@ //// [controlFlowGenericTypes.ts] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; export function bounceAndTakeIfA(value) { - return "A" === value && takeA(value), value; + return 'A' === value && takeA(value), value; } diff --git a/crates/swc/tests/tsc-references/controlFlowIfStatement.1.normal.js b/crates/swc/tests/tsc-references/controlFlowIfStatement.1.normal.js index b877f56cf8da..a4b273af1f91 100644 --- a/crates/swc/tests/tsc-references/controlFlowIfStatement.1.normal.js +++ b/crates/swc/tests/tsc-references/controlFlowIfStatement.1.normal.js @@ -31,15 +31,15 @@ function b() { x; // string } function c(data) { - if (typeof data === "string") { + if (typeof data === 'string') { return JSON.parse(data); } else { return data; } } function d(data) { - if (typeof data === "string") { - throw new Error("will always happen"); + if (typeof data === 'string') { + throw new Error('will always happen'); } else { return data; } diff --git a/crates/swc/tests/tsc-references/controlFlowInOperator.1.normal.js b/crates/swc/tests/tsc-references/controlFlowInOperator.1.normal.js index dd39732002f6..e1673ba1cd07 100644 --- a/crates/swc/tests/tsc-references/controlFlowInOperator.1.normal.js +++ b/crates/swc/tests/tsc-references/controlFlowInOperator.1.normal.js @@ -1,12 +1,12 @@ //// [controlFlowInOperator.ts] -var a = "a"; -var b = "b"; -var d = "d"; -if ("a" in c) { +var a = 'a'; +var b = 'b'; +var d = 'd'; +if ('a' in c) { c; // A - c["a"]; // number; + c['a']; // number; } -if ("d" in c) { +if ('d' in c) { c; // never } if (a in c) { diff --git a/crates/swc/tests/tsc-references/controlFlowInOperator.2.minified.js b/crates/swc/tests/tsc-references/controlFlowInOperator.2.minified.js index ab770409de0f..115da5ee52cc 100644 --- a/crates/swc/tests/tsc-references/controlFlowInOperator.2.minified.js +++ b/crates/swc/tests/tsc-references/controlFlowInOperator.2.minified.js @@ -1,2 +1,2 @@ //// [controlFlowInOperator.ts] -"a" in c && (c, c.a), "d" in c && c, "a" in c && (c, c.a), "d" in c && c; +'a' in c && (c, c.a), 'd' in c && c, 'a' in c && (c, c.a), 'd' in c && c; diff --git a/crates/swc/tests/tsc-references/controlFlowInstanceOfGuardPrimitives.1.normal.js b/crates/swc/tests/tsc-references/controlFlowInstanceOfGuardPrimitives.1.normal.js index df78a1aefc6d..88976da27ee3 100644 --- a/crates/swc/tests/tsc-references/controlFlowInstanceOfGuardPrimitives.1.normal.js +++ b/crates/swc/tests/tsc-references/controlFlowInstanceOfGuardPrimitives.1.normal.js @@ -3,7 +3,7 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; function distinguish(thing) { if (_instanceof(thing, Object)) { console.log("Aha!! It's a Date in " + thing.getFullYear()); - } else if (typeof thing === "string") { + } else if (typeof thing === 'string') { console.log("Aha!! It's a string of length " + thing.length); } else { console.log("Aha!! It's the number " + thing.toPrecision(3)); diff --git a/crates/swc/tests/tsc-references/controlFlowInstanceOfGuardPrimitives.2.minified.js b/crates/swc/tests/tsc-references/controlFlowInstanceOfGuardPrimitives.2.minified.js index 91bf6f0c6894..6710fac7d6cb 100644 --- a/crates/swc/tests/tsc-references/controlFlowInstanceOfGuardPrimitives.2.minified.js +++ b/crates/swc/tests/tsc-references/controlFlowInstanceOfGuardPrimitives.2.minified.js @@ -1,6 +1,6 @@ //// [controlFlowInstanceOfGuardPrimitives.ts] import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; function distinguish(thing) { - _instanceof(thing, Object) ? console.log("Aha!! It's a Date in " + thing.getFullYear()) : "string" == typeof thing ? console.log("Aha!! It's a string of length " + thing.length) : console.log("Aha!! It's the number " + thing.toPrecision(3)); + _instanceof(thing, Object) ? console.log("Aha!! It's a Date in " + thing.getFullYear()) : 'string' == typeof thing ? console.log("Aha!! It's a string of length " + thing.length) : console.log("Aha!! It's the number " + thing.toPrecision(3)); } distinguish(new Date()), distinguish("beef"), distinguish(3.14159265); diff --git a/crates/swc/tests/tsc-references/controlFlowOptionalChain.1.normal.js b/crates/swc/tests/tsc-references/controlFlowOptionalChain.1.normal.js index d55e065cab61..10629cbf9c0d 100644 --- a/crates/swc/tests/tsc-references/controlFlowOptionalChain.1.normal.js +++ b/crates/swc/tests/tsc-references/controlFlowOptionalChain.1.normal.js @@ -443,9 +443,9 @@ function f41(o1) { } function getArea(shape) { switch(shape === null || shape === void 0 ? void 0 : shape.type){ - case "circle": + case 'circle': return Math.PI * Math.pow(shape.radius, 2); - case "rectangle": + case 'rectangle': return shape.width * shape.height; default: return 0; @@ -453,7 +453,7 @@ function getArea(shape) { } function extractCoordinates(f1) { var _f_geometry; - if (((_f_geometry = f1.geometry) === null || _f_geometry === void 0 ? void 0 : _f_geometry.type) !== "test") { + if (((_f_geometry = f1.geometry) === null || _f_geometry === void 0 ? void 0 : _f_geometry.type) !== 'test') { return []; } return f1.geometry.coordinates; diff --git a/crates/swc/tests/tsc-references/controlFlowOptionalChain2.1.normal.js b/crates/swc/tests/tsc-references/controlFlowOptionalChain2.1.normal.js index 94b42b6269c3..ff7b33e32ef5 100644 --- a/crates/swc/tests/tsc-references/controlFlowOptionalChain2.1.normal.js +++ b/crates/swc/tests/tsc-references/controlFlowOptionalChain2.1.normal.js @@ -1,6 +1,6 @@ //// [controlFlowOptionalChain2.ts] function funcTwo(arg) { - if ((arg === null || arg === void 0 ? void 0 : arg.type) === "B") { + if ((arg === null || arg === void 0 ? void 0 : arg.type) === 'B') { arg; // `B` return; } @@ -8,7 +8,7 @@ function funcTwo(arg) { arg === null || arg === void 0 ? void 0 : arg.name; } function funcThree(arg) { - if ((arg === null || arg === void 0 ? void 0 : arg.type) === "B") { + if ((arg === null || arg === void 0 ? void 0 : arg.type) === 'B') { arg; // `B` return; } diff --git a/crates/swc/tests/tsc-references/controlFlowTypeofObject.1.normal.js b/crates/swc/tests/tsc-references/controlFlowTypeofObject.1.normal.js index 268d414cdc90..a16f7acd1d61 100644 --- a/crates/swc/tests/tsc-references/controlFlowTypeofObject.1.normal.js +++ b/crates/swc/tests/tsc-references/controlFlowTypeofObject.1.normal.js @@ -3,7 +3,7 @@ function f1(x) { if (!x) { return; } - if (typeof x === "object") { + if (typeof x === 'object') { obj(x); } } @@ -11,7 +11,7 @@ function f2(x) { if (x === null) { return; } - if (typeof x === "object") { + if (typeof x === 'object') { obj(x); } } @@ -19,7 +19,7 @@ function f3(x) { if (x == null) { return; } - if (typeof x === "object") { + if (typeof x === 'object') { obj(x); } } @@ -27,7 +27,7 @@ function f4(x) { if (x == undefined) { return; } - if (typeof x === "object") { + if (typeof x === 'object') { obj(x); } } @@ -41,7 +41,7 @@ function f5(x) { return; } } - if (typeof x === "object") { + if (typeof x === 'object') { obj(x); } } @@ -50,11 +50,11 @@ function f6(x) { x; } else { x; - if (typeof x === "object") { + if (typeof x === 'object') { obj(x); } } - if (typeof x === "object") { + if (typeof x === 'object') { obj(x); // Error } } diff --git a/crates/swc/tests/tsc-references/deleteChain.1.normal.js b/crates/swc/tests/tsc-references/deleteChain.1.normal.js index e914bf5c86ef..3ec55c201407 100644 --- a/crates/swc/tests/tsc-references/deleteChain.1.normal.js +++ b/crates/swc/tests/tsc-references/deleteChain.1.normal.js @@ -11,5 +11,5 @@ o2 === null || o2 === void 0 ? true : delete o2.b.c; (_o4_b2 = o4.b) === null || _o4_b2 === void 0 ? true : (_o4_b_c_d2 = _o4_b2.c.d) === null || _o4_b_c_d2 === void 0 ? true : delete _o4_b_c_d2.e; (_o5_b = o5.b) === null || _o5_b === void 0 ? true : (_o5_b_c_d = _o5_b.call(o5).c.d) === null || _o5_b_c_d === void 0 ? true : delete _o5_b_c_d.e; (_o5_b1 = o5.b) === null || _o5_b1 === void 0 ? true : (_o5_b_c_d1 = _o5_b1.call(o5).c.d) === null || _o5_b_c_d1 === void 0 ? true : delete _o5_b_c_d1.e; -(_o6_b = o6.b) === null || _o6_b === void 0 ? true : (_o6_b_c_d = _o6_b["c"].d) === null || _o6_b_c_d === void 0 ? true : delete _o6_b_c_d["e"]; -(_o6_b1 = o6.b) === null || _o6_b1 === void 0 ? true : (_o6_b_c_d1 = _o6_b1["c"].d) === null || _o6_b_c_d1 === void 0 ? true : delete _o6_b_c_d1["e"]; +(_o6_b = o6.b) === null || _o6_b === void 0 ? true : (_o6_b_c_d = _o6_b['c'].d) === null || _o6_b_c_d === void 0 ? true : delete _o6_b_c_d['e']; +(_o6_b1 = o6.b) === null || _o6_b1 === void 0 ? true : (_o6_b_c_d1 = _o6_b1['c'].d) === null || _o6_b_c_d1 === void 0 ? true : delete _o6_b_c_d1['e']; diff --git a/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers.1.normal.js b/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers.1.normal.js index 0985b45a14dc..75b59031f24e 100644 --- a/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers.1.normal.js @@ -15,7 +15,7 @@ var Base = /*#__PURE__*/ function() { { key: "c", get: function get() { - return ""; + return ''; }, set: function set(v) {} } @@ -23,7 +23,7 @@ var Base = /*#__PURE__*/ function() { { key: "t", get: function get() { - return ""; + return ''; }, set: function set(v) {} } @@ -44,11 +44,11 @@ var d = new Derived(1); var r1 = d.a; var r2 = d.b(); var r3 = d.c; -d.c = ""; +d.c = ''; var r4 = Derived.r; var r5 = Derived.s(); var r6 = Derived.t; -Derived.t = ""; +Derived.t = ''; var Base2 = function Base2() { "use strict"; _class_call_check(this, Base2); @@ -64,5 +64,5 @@ var Derived2 = /*#__PURE__*/ function(Base2) { return Derived2; }(Base2); var d2; -var r7 = d2[""]; +var r7 = d2['']; var r8 = d2[1]; diff --git a/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers.2.minified.js b/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers.2.minified.js index 0535b11e303d..2e92e190da26 100644 --- a/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassIncludesInheritedMembers.2.minified.js @@ -18,7 +18,7 @@ var d2, Derived = function(Base) { { key: "c", get: function() { - return ""; + return ''; }, set: function(v) {} } @@ -26,10 +26,10 @@ var d2, Derived = function(Base) { { key: "t", get: function() { - return ""; + return ''; }, set: function(v) {} } ]), Base; }()), d = new Derived(1); -d.a, d.b(), d.c, d.c = "", Derived.r, Derived.s(), Derived.t, Derived.t = "", d2[""], d2[1]; +d.a, d.b(), d.c, d.c = '', Derived.r, Derived.s(), Derived.t, Derived.t = '', d2[''], d2[1]; diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2.1.normal.js index c6a0d0d32395..0e863079ecbd 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2.1.normal.js @@ -89,5 +89,5 @@ var Derived2 = /*#__PURE__*/ function(Base2) { return Derived2; }(Base2); var d2; -var r7 = d2[""]; +var r7 = d2['']; var r8 = d2[1]; diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2.2.minified.js index 81d6d1ca1caf..ec4e9be49c10 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesProtectedMembers2.2.minified.js @@ -48,4 +48,4 @@ var x, y, d2, Derived = function(Base) { } ]), Base; }()), d = new Derived(y); -d.a, d.b(y), d.c, d.d, d.c = y, Derived.r, Derived.s(y), Derived.t, Derived.u, Derived.t = y, d2[""], d2[1]; +d.a, d.b(y), d.c, d.d, d.c = y, Derived.r, Derived.s(y), Derived.t, Derived.u, Derived.t = y, d2[''], d2[1]; diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers.1.normal.js b/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers.1.normal.js index 4da6fbd553ab..d7eb2f289260 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers.1.normal.js @@ -88,5 +88,5 @@ var Derived2 = /*#__PURE__*/ function(Base2) { return Derived2; }(Base2); var d2; -var r7 = d2[""]; +var r7 = d2['']; var r8 = d2[1]; diff --git a/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers.2.minified.js b/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers.2.minified.js index 70fcc5a72c39..7e2fe057b18d 100644 --- a/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassOverridesPublicMembers.2.minified.js @@ -48,4 +48,4 @@ var x, y, d2, Derived = function(Base) { } ]), Base; }()), d = new Derived(y); -d.a, d.b(y), d.c, d.d, d.c = y, Derived.r, Derived.s(y), Derived.t, Derived.u, Derived.t = y, d2[""], d2[1]; +d.a, d.b(y), d.c, d.d, d.c = y, Derived.r, Derived.s(y), Derived.t, Derived.u, Derived.t = y, d2[''], d2[1]; diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity.1.normal.js index 82d09c93b453..599cfee5793b 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity.1.normal.js @@ -43,4 +43,4 @@ var d; var e; c = e; var r = c.foo(1); -var r2 = e.foo(""); +var r2 = e.foo(''); diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity.2.minified.js b/crates/swc/tests/tsc-references/derivedClassTransitivity.2.minified.js index 828acc321112..80f113aaeae0 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity.2.minified.js @@ -3,4 +3,4 @@ var e; import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -e.foo(1), e.foo(""); +e.foo(1), e.foo(''); diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity2.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity2.1.normal.js index b414a15f69d1..42b801a77185 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity2.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity2.1.normal.js @@ -43,4 +43,4 @@ var d; var e; c = e; var r = c.foo(1, 1); -var r2 = e.foo(1, ""); +var r2 = e.foo(1, ''); diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity2.2.minified.js b/crates/swc/tests/tsc-references/derivedClassTransitivity2.2.minified.js index 6faebf923d57..175ef9ed6348 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity2.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity2.2.minified.js @@ -3,4 +3,4 @@ var e; import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -e.foo(1, 1), e.foo(1, ""); +e.foo(1, 1), e.foo(1, ''); diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity3.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity3.1.normal.js index 260c00818f60..579fced3d28c 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity3.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity3.1.normal.js @@ -42,5 +42,5 @@ var c; var d; var e; c = e; -var r = c.foo("", ""); -var r2 = e.foo("", 1); +var r = c.foo('', ''); +var r2 = e.foo('', 1); diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity3.2.minified.js b/crates/swc/tests/tsc-references/derivedClassTransitivity3.2.minified.js index 515b2dab223b..4af47ef26ebb 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity3.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity3.2.minified.js @@ -3,4 +3,4 @@ var e; import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -e.foo("", ""), e.foo("", 1); +e.foo('', ''), e.foo('', 1); diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity4.1.normal.js b/crates/swc/tests/tsc-references/derivedClassTransitivity4.1.normal.js index f7fe35804835..d681d25fc902 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity4.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity4.1.normal.js @@ -43,4 +43,4 @@ var d; var e; c = e; var r = c.foo(1); -var r2 = e.foo(""); +var r2 = e.foo(''); diff --git a/crates/swc/tests/tsc-references/derivedClassTransitivity4.2.minified.js b/crates/swc/tests/tsc-references/derivedClassTransitivity4.2.minified.js index 8eb37982a69d..4343b216b7ca 100644 --- a/crates/swc/tests/tsc-references/derivedClassTransitivity4.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassTransitivity4.2.minified.js @@ -3,4 +3,4 @@ var e; import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -e.foo(1), e.foo(""); +e.foo(1), e.foo(''); diff --git a/crates/swc/tests/tsc-references/derivedClassWithAny.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithAny.1.normal.js index 4f78713c47e5..f7441522a6dd 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithAny.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithAny.1.normal.js @@ -75,23 +75,23 @@ var E = /*#__PURE__*/ function(D) { } var _proto = E.prototype; _proto.foo = function foo() { - return ""; + return ''; }; E.bar = function bar() { - return ""; + return ''; }; _create_class(E, [ { key: "X", get: function get() { - return ""; + return ''; } } ], [ { key: "Y", get: function get() { - return ""; + return ''; } } ]); diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance.1.normal.js index a718d819bee2..89b982ea9131 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingProtectedInstance.1.normal.js @@ -10,7 +10,7 @@ var Base = /*#__PURE__*/ function() { } var _proto = Base.prototype; _proto.fn = function fn() { - return ""; + return ''; }; _create_class(Base, [ { @@ -34,7 +34,7 @@ var Derived = /*#__PURE__*/ function(Base) { } var _proto = Derived.prototype; _proto.fn = function fn() { - return ""; + return ''; }; _create_class(Derived, [ { diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance.1.normal.js index 1ed5f656cc05..7698ebcd928c 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance.1.normal.js @@ -10,7 +10,7 @@ var Base = /*#__PURE__*/ function() { } var _proto = Base.prototype; _proto.fn = function fn() { - return ""; + return ''; }; _create_class(Base, [ { @@ -34,7 +34,7 @@ var Derived = /*#__PURE__*/ function(Base) { } var _proto = Derived.prototype; _proto.fn = function fn() { - return ""; + return ''; }; _create_class(Derived, [ { diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance.2.minified.js index afbe64cedab7..49185ebaf530 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateInstanceShadowingPublicInstance.2.minified.js @@ -8,7 +8,7 @@ var Base = function() { _class_call_check(this, Base); } return Base.prototype.fn = function() { - return ""; + return ''; }, _create_class(Base, [ { key: "a", @@ -25,7 +25,7 @@ var Base = function() { return _class_call_check(this, Derived), _super.apply(this, arguments); } return Derived.prototype.fn = function() { - return ""; + return ''; }, _create_class(Derived, [ { key: "a", diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic.1.normal.js index d46aa13cf9a0..6271729963e9 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingProtectedStatic.1.normal.js @@ -9,7 +9,7 @@ var Base = /*#__PURE__*/ function() { _class_call_check(this, Base); } Base.fn = function fn() { - return ""; + return ''; }; _create_class(Base, null, [ { @@ -32,7 +32,7 @@ var Derived = /*#__PURE__*/ function(Base) { return _super.apply(this, arguments); } Derived.fn = function fn() { - return ""; + return ''; }; _create_class(Derived, null, [ { diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic.1.normal.js index 78b647fae829..694ce2ffbf1d 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic.1.normal.js @@ -9,7 +9,7 @@ var Base = /*#__PURE__*/ function() { _class_call_check(this, Base); } Base.fn = function fn() { - return ""; + return ''; }; _create_class(Base, null, [ { @@ -33,7 +33,7 @@ var Derived = /*#__PURE__*/ function(Base) { return _super.apply(this, arguments); } Derived.fn = function fn() { - return ""; + return ''; }; _create_class(Derived, null, [ { diff --git a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic.2.minified.js index c4f97068ac24..5f996893062c 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassWithPrivateStaticShadowingPublicStatic.2.minified.js @@ -8,7 +8,7 @@ var Base = function() { _class_call_check(this, Base); } return Base.fn = function() { - return ""; + return ''; }, _create_class(Base, null, [ { key: "a", @@ -25,7 +25,7 @@ var Base = function() { return _class_call_check(this, Derived), _super.apply(this, arguments); } return Derived.fn = function() { - return ""; + return ''; }, _create_class(Derived, null, [ { key: "a", diff --git a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor.1.normal.js index 35bf86257f75..e1e9d7d49c0e 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor.1.normal.js @@ -17,7 +17,7 @@ var Derived = /*#__PURE__*/ function(Base) { var _this; _this = _super.apply(this, arguments); _this.x = 1; - _this.y = "hello"; + _this.y = 'hello'; return _this; } return Derived; diff --git a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor.2.minified.js index f074302ce0e5..d98e911cdae6 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor.2.minified.js @@ -7,7 +7,7 @@ var Derived = function(Base) { var _super = _create_super(Derived); function Derived() { var _this; - return _class_call_check(this, Derived), _this = _super.apply(this, arguments), _this.x = 1, _this.y = "hello", _this; + return _class_call_check(this, Derived), _this = _super.apply(this, arguments), _this.x = 1, _this.y = 'hello', _this; } return Derived; }(function Base(x) { diff --git a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2.1.normal.js index 80e39255b00e..ecafb82d7440 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2.1.normal.js @@ -17,7 +17,7 @@ var Derived = /*#__PURE__*/ function(Base) { var _this; _this = _super.apply(this, arguments); _this.x = 1; - _this.y = "hello"; + _this.y = 'hello'; return _this; } return Derived; diff --git a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2.2.minified.js index c601c82185ff..22e557962e73 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor2.2.minified.js @@ -7,7 +7,7 @@ var Derived = function(Base) { var _super = _create_super(Derived); function Derived() { var _this; - return _class_call_check(this, Derived), _this = _super.apply(this, arguments), _this.x = 1, _this.y = "hello", _this; + return _class_call_check(this, Derived), _this = _super.apply(this, arguments), _this.x = 1, _this.y = 'hello', _this; } return Derived; }(function Base(x) { diff --git a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3.1.normal.js b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3.1.normal.js index 01e8138b0081..5d43fb42fbc2 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3.1.normal.js @@ -17,7 +17,7 @@ var Derived = /*#__PURE__*/ function(Base) { _class_call_check(this, Derived); var _this; _this = _super.call(this, 2); - _this.b = ""; + _this.b = ''; _this.b = y; return _this; } @@ -32,14 +32,14 @@ var Derived2 = /*#__PURE__*/ function(Derived) { var _this; _this = _super.apply(this, arguments); _this.x = 1; - _this.y = "hello"; + _this.y = 'hello'; return _this; } return Derived2; }(Derived); var r = new Derived(); // error var r2 = new Derived2(1); // error -var r3 = new Derived("", ""); +var r3 = new Derived('', ''); var Base2 = function Base2(x) { "use strict"; _class_call_check(this, Base2); diff --git a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3.2.minified.js b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3.2.minified.js index 1559f6c632f5..7f989c9889b0 100644 --- a/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3.2.minified.js +++ b/crates/swc/tests/tsc-references/derivedClassWithoutExplicitConstructor3.2.minified.js @@ -9,7 +9,7 @@ var Base = function Base(x) { var _super = _create_super(Derived); function Derived(y, z) { var _this; - return _class_call_check(this, Derived), (_this = _super.call(this, 2)).b = "", _this.b = y, _this; + return _class_call_check(this, Derived), (_this = _super.call(this, 2)).b = '', _this.b = y, _this; } return Derived; }(Base), Derived2 = function(Derived) { @@ -17,11 +17,11 @@ var Base = function Base(x) { var _super = _create_super(Derived2); function Derived2() { var _this; - return _class_call_check(this, Derived2), _this = _super.apply(this, arguments), _this.x = 1, _this.y = "hello", _this; + return _class_call_check(this, Derived2), _this = _super.apply(this, arguments), _this.x = 1, _this.y = 'hello', _this; } return Derived2; }(Derived); -new Derived(), new Derived2(1), new Derived("", ""); +new Derived(), new Derived2(1), new Derived('', ''); var D2 = function(D) { _inherits(D2, D); var _super = _create_super(D2); diff --git a/crates/swc/tests/tsc-references/derivedGenericClassWithAny.1.normal.js b/crates/swc/tests/tsc-references/derivedGenericClassWithAny.1.normal.js index b0d9260ba84a..509aafd46bd5 100644 --- a/crates/swc/tests/tsc-references/derivedGenericClassWithAny.1.normal.js +++ b/crates/swc/tests/tsc-references/derivedGenericClassWithAny.1.normal.js @@ -65,13 +65,13 @@ var E = /*#__PURE__*/ function(D) { } var _proto = E.prototype; _proto.foo = function foo() { - return ""; // error + return ''; // error }; _create_class(E, [ { key: "X", get: function get() { - return ""; + return ''; } // error } ]); diff --git a/crates/swc/tests/tsc-references/destructuringArrayBindingPatternAndAssignment5SiblingInitializer.1.normal.js b/crates/swc/tests/tsc-references/destructuringArrayBindingPatternAndAssignment5SiblingInitializer.1.normal.js index 9674890a2e74..8351bf4e3639 100644 --- a/crates/swc/tests/tsc-references/destructuringArrayBindingPatternAndAssignment5SiblingInitializer.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringArrayBindingPatternAndAssignment5SiblingInitializer.1.normal.js @@ -12,16 +12,16 @@ function f1() { // To be inferred as `string` function f2() { var _ref = [ - "hi" + 'hi' ], a1 = _ref[0], tmp = _ref[1], b1 = tmp === void 0 ? a1 : tmp; var _ref1 = [ - "hi" - ], a2 = _ref1[0], tmp1 = _ref1[1], b2 = tmp1 === void 0 ? a2 + "!" : tmp1; + 'hi' + ], a2 = _ref1[0], tmp1 = _ref1[1], b2 = tmp1 === void 0 ? a2 + '!' : tmp1; } // To be inferred as `string | number` function f3() { - var a1 = "hi", tmp = 1, b1 = tmp === void 0 ? a1 : tmp; - var a2 = "hi", tmp1 = 1, b2 = tmp1 === void 0 ? a2 + "!" : tmp1; + var a1 = 'hi', tmp = 1, b1 = tmp === void 0 ? a1 : tmp; + var a2 = 'hi', tmp1 = 1, b2 = tmp1 === void 0 ? a2 + '!' : tmp1; } function f4() { var _ref = _sliced_to_array(yadda !== null && yadda !== void 0 ? yadda : [], 2), a = _ref[0], tmp = _ref[1], b = tmp === void 0 ? a : tmp; diff --git a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment9SiblingInitializer.1.normal.js b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment9SiblingInitializer.1.normal.js index d47bd98e84ef..3ecd6b478125 100644 --- a/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment9SiblingInitializer.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringObjectBindingPatternAndAssignment9SiblingInitializer.1.normal.js @@ -11,22 +11,22 @@ function f1() { // To be inferred as `string` function f2() { var _ref = { - a1: "hi" + a1: 'hi' }, a1 = _ref.a1, _ref_b1 = _ref.b1, b1 = _ref_b1 === void 0 ? a1 : _ref_b1; var _ref1 = { - a2: "hi" - }, a2 = _ref1.a2, _ref_b2 = _ref1.b2, b2 = _ref_b2 === void 0 ? a2 + "!" : _ref_b2; + a2: 'hi' + }, a2 = _ref1.a2, _ref_b2 = _ref1.b2, b2 = _ref_b2 === void 0 ? a2 + '!' : _ref_b2; } // To be inferred as `string | number` function f3() { var _ref = { - a1: "hi", + a1: 'hi', b1: 1 }, a1 = _ref.a1, _ref_b1 = _ref.b1, b1 = _ref_b1 === void 0 ? a1 : _ref_b1; var _ref1 = { - a2: "hi", + a2: 'hi', b2: 1 - }, a2 = _ref1.a2, _ref_b2 = _ref1.b2, b2 = _ref_b2 === void 0 ? a2 + "!" : _ref_b2; + }, a2 = _ref1.a2, _ref_b2 = _ref1.b2, b2 = _ref_b2 === void 0 ? a2 + '!' : _ref_b2; } function f4() { var _ref = yadda !== null && yadda !== void 0 ? yadda : {}, a = _ref.a, _ref_b = _ref.b, b = _ref_b === void 0 ? a : _ref_b; diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration8.1.normal.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration8.1.normal.js index ebf6124faf5a..ee4b52a4831f 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration8.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration8.1.normal.js @@ -2,26 +2,26 @@ // explicit type annotation should cause `method` to have type 'x' | 'y' // both inside and outside `test`. function test(param) { - var _param_method = param.method, method = _param_method === void 0 ? "z" : _param_method, _param_nested = param.nested, _param_nested_p = _param_nested.p, p = _param_nested_p === void 0 ? "c" : _param_nested_p; + var _param_method = param.method, method = _param_method === void 0 ? 'z' : _param_method, _param_nested = param.nested, _param_nested_p = _param_nested.p, p = _param_nested_p === void 0 ? 'c' : _param_nested_p; method; p; } test({}); test({ - method: "x", + method: 'x', nested: { - p: "a" + p: 'a' } }); test({ - method: "z", + method: 'z', nested: { - p: "b" + p: 'b' } }); test({ - method: "one", + method: 'one', nested: { - p: "a" + p: 'a' } }); diff --git a/crates/swc/tests/tsc-references/destructuringParameterDeclaration8.2.minified.js b/crates/swc/tests/tsc-references/destructuringParameterDeclaration8.2.minified.js index 864f9539a95e..35f9040758f2 100644 --- a/crates/swc/tests/tsc-references/destructuringParameterDeclaration8.2.minified.js +++ b/crates/swc/tests/tsc-references/destructuringParameterDeclaration8.2.minified.js @@ -3,18 +3,18 @@ function test(param) { param.method, param.nested.p; } test({}), test({ - method: "x", + method: 'x', nested: { - p: "a" + p: 'a' } }), test({ - method: "z", + method: 'z', nested: { - p: "b" + p: 'b' } }), test({ - method: "one", + method: 'one', nested: { - p: "a" + p: 'a' } }); diff --git a/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers2.1.normal.js b/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers2.1.normal.js index f3ff65962f5a..6e878b03a42e 100644 --- a/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers2.1.normal.js +++ b/crates/swc/tests/tsc-references/destructuringWithLiteralInitializers2.1.normal.js @@ -14,7 +14,7 @@ function f02() { function f03() { var _ref = _sliced_to_array(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [ 1, - "foo" + 'foo' ], 2), x = _ref[0], y = _ref[1]; } function f10(param) { @@ -31,57 +31,57 @@ function f12() { function f13() { var _ref = _sliced_to_array(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [ 1, - "foo" + 'foo' ], 2), tmp = _ref[0], x = tmp === void 0 ? 0 : tmp, y = _ref[1]; } function f20(param) { - var _param = _sliced_to_array(param, 2), tmp = _param[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _param[1], y = tmp1 === void 0 ? "bar" : tmp1; + var _param = _sliced_to_array(param, 2), tmp = _param[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _param[1], y = tmp1 === void 0 ? 'bar' : tmp1; } function f21() { - var _ref = _sliced_to_array(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], 2), tmp = _ref[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _ref[1], y = tmp1 === void 0 ? "bar" : tmp1; + var _ref = _sliced_to_array(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], 2), tmp = _ref[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _ref[1], y = tmp1 === void 0 ? 'bar' : tmp1; } function f22() { var _ref = _sliced_to_array(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [ 1 - ], 2), tmp = _ref[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _ref[1], y = tmp1 === void 0 ? "bar" : tmp1; + ], 2), tmp = _ref[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _ref[1], y = tmp1 === void 0 ? 'bar' : tmp1; } function f23() { var _ref = _sliced_to_array(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [ 1, - "foo" - ], 2), tmp = _ref[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _ref[1], y = tmp1 === void 0 ? "bar" : tmp1; + 'foo' + ], 2), tmp = _ref[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _ref[1], y = tmp1 === void 0 ? 'bar' : tmp1; } function f30(param) { - var _param = _sliced_to_array(param, 2), tmp = _param[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _param[1], y = tmp1 === void 0 ? "bar" : tmp1; + var _param = _sliced_to_array(param, 2), tmp = _param[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _param[1], y = tmp1 === void 0 ? 'bar' : tmp1; } function f31() { - var _ref = _sliced_to_array(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], 2), tmp = _ref[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _ref[1], y = tmp1 === void 0 ? "bar" : tmp1; + var _ref = _sliced_to_array(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], 2), tmp = _ref[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _ref[1], y = tmp1 === void 0 ? 'bar' : tmp1; } function f32() { var _ref = _sliced_to_array(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [ nx - ], 2), tmp = _ref[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _ref[1], y = tmp1 === void 0 ? "bar" : tmp1; + ], 2), tmp = _ref[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _ref[1], y = tmp1 === void 0 ? 'bar' : tmp1; } function f33() { var _ref = _sliced_to_array(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [ nx, sx - ], 2), tmp = _ref[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _ref[1], y = tmp1 === void 0 ? "bar" : tmp1; + ], 2), tmp = _ref[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _ref[1], y = tmp1 === void 0 ? 'bar' : tmp1; } function f40(param) { - var _param = _sliced_to_array(param, 2), tmp = _param[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _param[1], y = tmp1 === void 0 ? "bar" : tmp1; + var _param = _sliced_to_array(param, 2), tmp = _param[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _param[1], y = tmp1 === void 0 ? 'bar' : tmp1; } function f41() { - var _ref = _sliced_to_array(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], 2), tmp = _ref[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _ref[1], y = tmp1 === void 0 ? "bar" : tmp1; + var _ref = _sliced_to_array(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], 2), tmp = _ref[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _ref[1], y = tmp1 === void 0 ? 'bar' : tmp1; } function f42() { var _ref = _sliced_to_array(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [ sx - ], 2), tmp = _ref[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _ref[1], y = tmp1 === void 0 ? "bar" : tmp1; + ], 2), tmp = _ref[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _ref[1], y = tmp1 === void 0 ? 'bar' : tmp1; } function f43() { var _ref = _sliced_to_array(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [ sx, nx - ], 2), tmp = _ref[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _ref[1], y = tmp1 === void 0 ? "bar" : tmp1; + ], 2), tmp = _ref[0], x = tmp === void 0 ? 0 : tmp, tmp1 = _ref[1], y = tmp1 === void 0 ? 'bar' : tmp1; } diff --git a/crates/swc/tests/tsc-references/discriminatedUnionInference.1.normal.js b/crates/swc/tests/tsc-references/discriminatedUnionInference.1.normal.js index 5906afe3185a..2a683c85940b 100644 --- a/crates/swc/tests/tsc-references/discriminatedUnionInference.1.normal.js +++ b/crates/swc/tests/tsc-references/discriminatedUnionInference.1.normal.js @@ -1,11 +1,11 @@ //// [discriminatedUnionInference.ts] // Repro from #28862 var x1 = foo({ - kind: "a", + kind: 'a', data: 42 }); // number var x2 = foo({ - kind: "b", + kind: 'b', data: [ 1, 2 diff --git a/crates/swc/tests/tsc-references/discriminatedUnionInference.2.minified.js b/crates/swc/tests/tsc-references/discriminatedUnionInference.2.minified.js index 7b475a4787c3..f8389c23b93d 100644 --- a/crates/swc/tests/tsc-references/discriminatedUnionInference.2.minified.js +++ b/crates/swc/tests/tsc-references/discriminatedUnionInference.2.minified.js @@ -1,9 +1,9 @@ //// [discriminatedUnionInference.ts] foo({ - kind: "a", + kind: 'a', data: 42 }), foo({ - kind: "b", + kind: 'b', data: [ 1, 2 diff --git a/crates/swc/tests/tsc-references/discriminatedUnionTypes2.1.normal.js b/crates/swc/tests/tsc-references/discriminatedUnionTypes2.1.normal.js index 056db3bd3e44..ee1f9da1295b 100644 --- a/crates/swc/tests/tsc-references/discriminatedUnionTypes2.1.normal.js +++ b/crates/swc/tests/tsc-references/discriminatedUnionTypes2.1.normal.js @@ -69,21 +69,21 @@ function f31(foo) { } } function f(problem) { - if (problem.type === "b") { + if (problem.type === 'b') { problem.name; } else { problem.other; } } function foo1(x) { - if (x.type === "number") { + if (x.type === 'number') { x.value; // number } else { x.value; // number } } function foo2(x) { - if (x.type === "number") { + if (x.type === 'number') { x.value; // number } else { x.value; // string diff --git a/crates/swc/tests/tsc-references/enumBasics.1.normal.js b/crates/swc/tests/tsc-references/enumBasics.1.normal.js index 2354d01e692c..4554c063577a 100644 --- a/crates/swc/tests/tsc-references/enumBasics.1.normal.js +++ b/crates/swc/tests/tsc-references/enumBasics.1.normal.js @@ -25,7 +25,7 @@ var E2; var E3; // Enum with only computed members (function(E3) { - E3[E3["X"] = "foo".length] = "X"; + E3[E3["X"] = 'foo'.length] = "X"; E3[E3["Y"] = 7] = "Y"; E3[E3["Z"] = +"foo"] = "Z"; })(E3 || (E3 = {})); @@ -34,7 +34,7 @@ var E4; (function(E4) { E4[E4["X"] = 0] = "X"; E4[E4["Y"] = 1] = "Y"; - E4[E4["Z"] = "foo".length] = "Z"; + E4[E4["Z"] = 'foo'.length] = "Z"; })(E4 || (E4 = {})); var E5; // Enum with > 2 constant members with no initializer for first member, non zero initializer for second element @@ -52,12 +52,12 @@ var E6; var E7; // Enum with computed member initializer of type 'any' (function(E7) { - E7[E7["A"] = "foo"["foo"]] = "A"; + E7[E7["A"] = 'foo'['foo']] = "A"; })(E7 || (E7 = {})); var E8; // Enum with computed member initializer of type number (function(E8) { - E8[E8["B"] = "foo"["foo"]] = "B"; + E8[E8["B"] = 'foo'['foo']] = "B"; })(E8 || (E8 = {})); var E9; //Enum with computed member intializer of same enum type diff --git a/crates/swc/tests/tsc-references/enumBasics.2.minified.js b/crates/swc/tests/tsc-references/enumBasics.2.minified.js index 2b1aca30ee8f..c8e0e8e104e9 100644 --- a/crates/swc/tests/tsc-references/enumBasics.2.minified.js +++ b/crates/swc/tests/tsc-references/enumBasics.2.minified.js @@ -1,4 +1,4 @@ //// [enumBasics.ts] (E1 = E11 || (E11 = {}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C"; var E2, E3, E4, E5, E6, E7, E8, E9, E1, E11, E21, E31, E41, E51, E61, E71, E81, E91, e = E11; -E11[e.A], (E2 = E21 || (E21 = {}))[E2.A = 1] = "A", E2[E2.B = 2] = "B", E2[E2.C = 3] = "C", (E3 = E31 || (E31 = {}))[E3.X = 3] = "X", E3[E3.Y = 7] = "Y", E3[E3.Z = NaN] = "Z", (E4 = E41 || (E41 = {}))[E4.X = 0] = "X", E4[E4.Y = 1] = "Y", E4[E4.Z = 3] = "Z", (E5 = E51 || (E51 = {}))[E5.A = 0] = "A", E5[E5.B = 3] = "B", E5[E5.C = 4] = "C", (E6 = E61 || (E61 = {}))[E6.A = 0] = "A", E6[E6.B = 0] = "B", E6[E6.C = 1] = "C", (E7 = E71 || (E71 = {}))[E7.A = "foo".foo] = "A", (E8 = E81 || (E81 = {}))[E8.B = "foo".foo] = "B", (E9 = E91 || (E91 = {}))[E9.A = 0] = "A", E9[E9.B = 0] = "B", E81.B, E71.A, E41.Z, E31.X, E31.Z; +E11[e.A], (E2 = E21 || (E21 = {}))[E2.A = 1] = "A", E2[E2.B = 2] = "B", E2[E2.C = 3] = "C", (E3 = E31 || (E31 = {}))[E3.X = 3] = "X", E3[E3.Y = 7] = "Y", E3[E3.Z = NaN] = "Z", (E4 = E41 || (E41 = {}))[E4.X = 0] = "X", E4[E4.Y = 1] = "Y", E4[E4.Z = 3] = "Z", (E5 = E51 || (E51 = {}))[E5.A = 0] = "A", E5[E5.B = 3] = "B", E5[E5.C = 4] = "C", (E6 = E61 || (E61 = {}))[E6.A = 0] = "A", E6[E6.B = 0] = "B", E6[E6.C = 1] = "C", (E7 = E71 || (E71 = {}))[E7.A = 'foo'.foo] = "A", (E8 = E81 || (E81 = {}))[E8.B = 'foo'.foo] = "B", (E9 = E91 || (E91 = {}))[E9.A = 0] = "A", E9[E9.B = 0] = "B", E81.B, E71.A, E41.Z, E31.X, E31.Z; diff --git a/crates/swc/tests/tsc-references/enumMerging.1.normal.js b/crates/swc/tests/tsc-references/enumMerging.1.normal.js index 5339ebd375e5..35241b80924e 100644 --- a/crates/swc/tests/tsc-references/enumMerging.1.normal.js +++ b/crates/swc/tests/tsc-references/enumMerging.1.normal.js @@ -39,14 +39,14 @@ var M2; (function(M2) { var EComp2; (function(EComp2) { - EComp2[EComp2["A"] = "foo".length] = "A"; - EComp2[EComp2["B"] = "foo".length] = "B"; - EComp2[EComp2["C"] = "foo".length] = "C"; + EComp2[EComp2["A"] = 'foo'.length] = "A"; + EComp2[EComp2["B"] = 'foo'.length] = "B"; + EComp2[EComp2["C"] = 'foo'.length] = "C"; })(EComp2 = M2.EComp2 || (M2.EComp2 = {})); (function(EComp2) { - EComp2[EComp2["D"] = "foo".length] = "D"; - EComp2[EComp2["E"] = "foo".length] = "E"; - EComp2[EComp2["F"] = "foo".length] = "F"; + EComp2[EComp2["D"] = 'foo'.length] = "D"; + EComp2[EComp2["E"] = 'foo'.length] = "E"; + EComp2[EComp2["F"] = 'foo'.length] = "F"; })(EComp2 = M2.EComp2 || (M2.EComp2 = {})); var x = [ EComp2.A, diff --git a/crates/swc/tests/tsc-references/enumMergingErrors.1.normal.js b/crates/swc/tests/tsc-references/enumMergingErrors.1.normal.js index b1db4f8dd36a..805fe2d5f410 100644 --- a/crates/swc/tests/tsc-references/enumMergingErrors.1.normal.js +++ b/crates/swc/tests/tsc-references/enumMergingErrors.1.normal.js @@ -18,11 +18,11 @@ var M; (function(M) { var E1; (function(E1) { - E1[E1["B"] = "foo".length] = "B"; + E1[E1["B"] = 'foo'.length] = "B"; })(E1 = M.E1 || (M.E1 = {})); var E2; (function(E2) { - E2[E2["B"] = "foo".length] = "B"; + E2[E2["B"] = 'foo'.length] = "B"; })(E2 = M.E2 || (M.E2 = {})); var E3; (function(E3) { @@ -40,7 +40,7 @@ var M; })(E2 = M.E2 || (M.E2 = {})); var E3; (function(E3) { - E3[E3["B"] = "foo".length] = "B"; + E3[E3["B"] = 'foo'.length] = "B"; })(E3 = M.E3 || (M.E3 = {})); })(M || (M = {})); var M1; diff --git a/crates/swc/tests/tsc-references/enumTag.1.normal.js b/crates/swc/tests/tsc-references/enumTag.1.normal.js index 6289e0e7c702..39cccda0bd6a 100644 --- a/crates/swc/tests/tsc-references/enumTag.1.normal.js +++ b/crates/swc/tests/tsc-references/enumTag.1.normal.js @@ -34,7 +34,7 @@ ; v = Second.MISTAKE // meh..ok, I guess? ; - v = "something else" // allowed, like Typescript's classic enums and unlike its string enums + v = 'something else' // allowed, like Typescript's classic enums and unlike its string enums ; } /** @param {string} s */ function ff(s) { diff --git a/crates/swc/tests/tsc-references/enumTagImported.1.normal.js b/crates/swc/tests/tsc-references/enumTagImported.1.normal.js index 9ddd9d3bb8e8..807b27560e5e 100644 --- a/crates/swc/tests/tsc-references/enumTagImported.1.normal.js +++ b/crates/swc/tests/tsc-references/enumTagImported.1.normal.js @@ -1,11 +1,11 @@ //// [type.js] -/** @typedef {import("./mod1").TestEnum} TE */ /** @type {TE} */ var test = "add"; -/** @type {import("./mod1").TestEnum} */ var tost = "remove"; +/** @typedef {import("./mod1").TestEnum} TE */ /** @type {TE} */ var test = 'add'; +/** @type {import("./mod1").TestEnum} */ var tost = 'remove'; //// [value.js] import { TestEnum } from "./mod1"; /** @type {TestEnum} */ var tist = TestEnum.ADD; //// [mod1.js] /** @enum {string} */ export var TestEnum = { - ADD: "add", - REMOVE: "remove" + ADD: 'add', + REMOVE: 'remove' }; diff --git a/crates/swc/tests/tsc-references/enumTagImported.2.minified.js b/crates/swc/tests/tsc-references/enumTagImported.2.minified.js index 54c39804e177..d253a5faee13 100644 --- a/crates/swc/tests/tsc-references/enumTagImported.2.minified.js +++ b/crates/swc/tests/tsc-references/enumTagImported.2.minified.js @@ -4,6 +4,6 @@ import { TestEnum } from "./mod1"; TestEnum.ADD; //// [mod1.js] export var TestEnum = { - ADD: "add", - REMOVE: "remove" + ADD: 'add', + REMOVE: 'remove' }; diff --git a/crates/swc/tests/tsc-references/enums.1.normal.js b/crates/swc/tests/tsc-references/enums.1.normal.js index 1fdb0cc491b2..375a4e2d7cca 100644 --- a/crates/swc/tests/tsc-references/enums.1.normal.js +++ b/crates/swc/tests/tsc-references/enums.1.normal.js @@ -17,5 +17,5 @@ var kind; var flags; export { }; //// [/c.ts] -import { SymbolFlags } from "./a"; +import { SymbolFlags } from './a'; var flags = SymbolFlags.Type; diff --git a/crates/swc/tests/tsc-references/enums.2.minified.js b/crates/swc/tests/tsc-references/enums.2.minified.js index e1549c061504..55b616c85228 100644 --- a/crates/swc/tests/tsc-references/enums.2.minified.js +++ b/crates/swc/tests/tsc-references/enums.2.minified.js @@ -6,5 +6,5 @@ export { SymbolFlags }; SyntaxKind.ImportClause, SymbolFlags.Type; export { }; //// [/c.ts] -import { SymbolFlags } from "./a"; +import { SymbolFlags } from './a'; SymbolFlags.Type; diff --git a/crates/swc/tests/tsc-references/errorSuperPropertyAccess.1.normal.js b/crates/swc/tests/tsc-references/errorSuperPropertyAccess.1.normal.js index b6f795fdb0e8..eba9b1254ce0 100644 --- a/crates/swc/tests/tsc-references/errorSuperPropertyAccess.1.normal.js +++ b/crates/swc/tests/tsc-references/errorSuperPropertyAccess.1.normal.js @@ -15,29 +15,29 @@ var NoBase = /*#__PURE__*/ function() { function NoBase() { _class_call_check(this, NoBase); this.m = _get(_get_prototype_of(NoBase.prototype), "prototype", this); - this.n = _get(_get_prototype_of(NoBase.prototype), "hasOwnProperty", this).call(this, ""); + this.n = _get(_get_prototype_of(NoBase.prototype), "hasOwnProperty", this).call(this, ''); var a = _get(_get_prototype_of(NoBase.prototype), "prototype", this); - var b = _get(_get_prototype_of(NoBase.prototype), "hasOwnProperty", this).call(this, ""); + var b = _get(_get_prototype_of(NoBase.prototype), "hasOwnProperty", this).call(this, ''); } var _proto = NoBase.prototype; _proto.fn = function fn() { var a = _get(_get_prototype_of(NoBase.prototype), "prototype", this); - var b = _get(_get_prototype_of(NoBase.prototype), "hasOwnProperty", this).call(this, ""); + var b = _get(_get_prototype_of(NoBase.prototype), "hasOwnProperty", this).call(this, ''); }; //super static property access in static member function of class with no base type //super static property access in static member accessor(get and set) of class with no base type NoBase.static1 = function static1() { - _get(_get_prototype_of(NoBase), "hasOwnProperty", this).call(this, ""); + _get(_get_prototype_of(NoBase), "hasOwnProperty", this).call(this, ''); }; _create_class(NoBase, null, [ { key: "static2", get: function get() { - _get(_get_prototype_of(NoBase), "hasOwnProperty", this).call(this, ""); - return ""; + _get(_get_prototype_of(NoBase), "hasOwnProperty", this).call(this, ''); + return ''; }, set: function set(n) { - _get(_get_prototype_of(NoBase), "hasOwnProperty", this).call(this, ""); + _get(_get_prototype_of(NoBase), "hasOwnProperty", this).call(this, ''); } } ]); @@ -156,7 +156,7 @@ var SomeDerived3 = /*#__PURE__*/ function(SomeBase) { _set(_get_prototype_of(SomeDerived3), "publicStaticMember", 3, this, true); _set(_get_prototype_of(SomeDerived3), "privateStaticMember", 3, this, true); _get(_get_prototype_of(SomeDerived3), "privateStaticFunc", this).call(this); - return ""; + return ''; }, set: function set(n) { _set(_get_prototype_of(SomeDerived3), "publicStaticMember", 3, this, true); diff --git a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer.1.normal.js b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer.1.normal.js index 217e844cc559..1dc928752176 100644 --- a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer.1.normal.js +++ b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInitializer.1.normal.js @@ -24,7 +24,7 @@ var M; M.F2 = F2; })(M || (M = {})); var aNumber = 9.9; -var aString = "this is a string"; +var aString = 'this is a string'; var aDate = new Date(12); var anObject = new Object(); var anAny = null; @@ -45,5 +45,5 @@ var aLambda = function(x) { var aModule = M; var aClassInModule = new M.A(); var aFunctionInModule = function(x) { - return "this is a string"; + return 'this is a string'; }; diff --git a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer.1.normal.js b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer.1.normal.js index 560cf45459a2..b3982a947a4a 100644 --- a/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer.1.normal.js +++ b/crates/swc/tests/tsc-references/everyTypeWithAnnotationAndInvalidInitializer.1.normal.js @@ -38,7 +38,7 @@ var N; } N.F2 = F2; })(N || (N = {})); -var aNumber = "this is a string"; +var aNumber = 'this is a string'; var aString = 9.9; var aDate = 9.9; var aVoid = 9.9; @@ -46,13 +46,13 @@ var anInterface = new D(); var aClass = new D(); var aGenericClass = new C(); var anObjectLiteral = { - id: "a string" + id: 'a string' }; var anOtherObjectLiteral = new C(); var aFunction = F2; var anOtherFunction = F2; var aLambda = function(x) { - return "a string"; + return 'a string'; }; var aModule = N; var aClassInModule = new N.A(); diff --git a/crates/swc/tests/tsc-references/everyTypeWithInitializer.1.normal.js b/crates/swc/tests/tsc-references/everyTypeWithInitializer.1.normal.js index 783aaefc81e7..8bf771477023 100644 --- a/crates/swc/tests/tsc-references/everyTypeWithInitializer.1.normal.js +++ b/crates/swc/tests/tsc-references/everyTypeWithInitializer.1.normal.js @@ -24,7 +24,7 @@ var M; M.F2 = F2; })(M || (M = {})); var aNumber = 9.9; -var aString = "this is a string"; +var aString = 'this is a string'; var aDate = new Date(12); var anObject = new Object(); var anAny = null; diff --git a/crates/swc/tests/tsc-references/exhaustiveSwitchStatements1.1.normal.js b/crates/swc/tests/tsc-references/exhaustiveSwitchStatements1.1.normal.js index 2ef6ea65bd50..fe0ec581caaa 100644 --- a/crates/swc/tests/tsc-references/exhaustiveSwitchStatements1.1.normal.js +++ b/crates/swc/tests/tsc-references/exhaustiveSwitchStatements1.1.normal.js @@ -3,9 +3,9 @@ function f1(x) { if (!!true) { switch(x){ case 1: - return "a"; + return 'a'; case 2: - return "b"; + return 'b'; } x; // Unreachable } else { @@ -222,10 +222,10 @@ function foo() { } function ff(o, k) { switch(k){ - case "c": - k = "a"; + case 'c': + k = 'a'; } - k === "c"; // Error + k === 'c'; // Error return o[k]; } function f35431(a) { diff --git a/crates/swc/tests/tsc-references/exportAsNamespace1(module=es6).1.normal.js b/crates/swc/tests/tsc-references/exportAsNamespace1(module=es6).1.normal.js index 4e9186f63afe..1b2d2fe2cb46 100644 --- a/crates/swc/tests/tsc-references/exportAsNamespace1(module=es6).1.normal.js +++ b/crates/swc/tests/tsc-references/exportAsNamespace1(module=es6).1.normal.js @@ -2,11 +2,11 @@ export var a = 1; export var b = 2; //// [1.ts] -import * as _ns from "./0"; +import * as _ns from './0'; export { _ns as ns }; ns.a; ns.b; //// [2.ts] -import * as foo from "./1"; +import * as foo from './1'; foo.ns.a; foo.ns.b; diff --git a/crates/swc/tests/tsc-references/exportAsNamespace1(module=es6).2.minified.js b/crates/swc/tests/tsc-references/exportAsNamespace1(module=es6).2.minified.js index 7e9dd8923ff1..9319ace8acc8 100644 --- a/crates/swc/tests/tsc-references/exportAsNamespace1(module=es6).2.minified.js +++ b/crates/swc/tests/tsc-references/exportAsNamespace1(module=es6).2.minified.js @@ -2,9 +2,9 @@ export var a = 1; export var b = 2; //// [1.ts] -import * as _ns from "./0"; +import * as _ns from './0'; ns.a, ns.b; export { _ns as ns }; //// [2.ts] -import * as foo from "./1"; +import * as foo from './1'; foo.ns.a, foo.ns.b; diff --git a/crates/swc/tests/tsc-references/exportAsNamespace2(module=es6).1.normal.js b/crates/swc/tests/tsc-references/exportAsNamespace2(module=es6).1.normal.js index 4e9186f63afe..1b2d2fe2cb46 100644 --- a/crates/swc/tests/tsc-references/exportAsNamespace2(module=es6).1.normal.js +++ b/crates/swc/tests/tsc-references/exportAsNamespace2(module=es6).1.normal.js @@ -2,11 +2,11 @@ export var a = 1; export var b = 2; //// [1.ts] -import * as _ns from "./0"; +import * as _ns from './0'; export { _ns as ns }; ns.a; ns.b; //// [2.ts] -import * as foo from "./1"; +import * as foo from './1'; foo.ns.a; foo.ns.b; diff --git a/crates/swc/tests/tsc-references/exportAsNamespace2(module=es6).2.minified.js b/crates/swc/tests/tsc-references/exportAsNamespace2(module=es6).2.minified.js index 7e9dd8923ff1..9319ace8acc8 100644 --- a/crates/swc/tests/tsc-references/exportAsNamespace2(module=es6).2.minified.js +++ b/crates/swc/tests/tsc-references/exportAsNamespace2(module=es6).2.minified.js @@ -2,9 +2,9 @@ export var a = 1; export var b = 2; //// [1.ts] -import * as _ns from "./0"; +import * as _ns from './0'; ns.a, ns.b; export { _ns as ns }; //// [2.ts] -import * as foo from "./1"; +import * as foo from './1'; foo.ns.a, foo.ns.b; diff --git a/crates/swc/tests/tsc-references/exportAsNamespace3(module=es6).1.normal.js b/crates/swc/tests/tsc-references/exportAsNamespace3(module=es6).1.normal.js index dffe90517994..2aff9fbe26a6 100644 --- a/crates/swc/tests/tsc-references/exportAsNamespace3(module=es6).1.normal.js +++ b/crates/swc/tests/tsc-references/exportAsNamespace3(module=es6).1.normal.js @@ -2,7 +2,7 @@ export var a = 1; export var b = 2; //// [1.ts] -import * as _ns from "./0"; +import * as _ns from './0'; export { _ns as ns }; ns.a; ns.b; @@ -13,6 +13,6 @@ var ns = { ns.a; ns.b; //// [2.ts] -import * as foo from "./1"; +import * as foo from './1'; foo.ns.a; foo.ns.b; diff --git a/crates/swc/tests/tsc-references/exportAsNamespace3(module=es6).2.minified.js b/crates/swc/tests/tsc-references/exportAsNamespace3(module=es6).2.minified.js index 4a38b264c94a..8f3f01e14f28 100644 --- a/crates/swc/tests/tsc-references/exportAsNamespace3(module=es6).2.minified.js +++ b/crates/swc/tests/tsc-references/exportAsNamespace3(module=es6).2.minified.js @@ -2,7 +2,7 @@ export var a = 1; export var b = 2; //// [1.ts] -import * as _ns from "./0"; +import * as _ns from './0'; ns.a, ns.b; var ns = { a: 1, @@ -11,5 +11,5 @@ var ns = { ns.a, ns.b; export { _ns as ns }; //// [2.ts] -import * as foo from "./1"; +import * as foo from './1'; foo.ns.a, foo.ns.b; diff --git a/crates/swc/tests/tsc-references/exportAsNamespace4(module=es6).1.normal.js b/crates/swc/tests/tsc-references/exportAsNamespace4(module=es6).1.normal.js index 426a33572e76..b019302afbea 100644 --- a/crates/swc/tests/tsc-references/exportAsNamespace4(module=es6).1.normal.js +++ b/crates/swc/tests/tsc-references/exportAsNamespace4(module=es6).1.normal.js @@ -2,14 +2,14 @@ export var a = 1; export var b = 2; //// [1.ts] -import * as _default from "./0"; +import * as _default from './0'; export { _default as default }; //// [11.ts] -import * as ns from "./0"; +import * as ns from './0'; export default ns; //// [2.ts] -import foo from "./1"; -import foo1 from "./11"; +import foo from './1'; +import foo1 from './11'; foo.a; foo1.a; foo.b; diff --git a/crates/swc/tests/tsc-references/exportAsNamespace4(module=es6).2.minified.js b/crates/swc/tests/tsc-references/exportAsNamespace4(module=es6).2.minified.js index ced12e4d1ff7..dff7385406bc 100644 --- a/crates/swc/tests/tsc-references/exportAsNamespace4(module=es6).2.minified.js +++ b/crates/swc/tests/tsc-references/exportAsNamespace4(module=es6).2.minified.js @@ -2,12 +2,12 @@ export var a = 1; export var b = 2; //// [1.ts] -import * as _default from "./0"; +import * as _default from './0'; export { _default as default }; //// [11.ts] -import * as ns from "./0"; +import * as ns from './0'; export default ns; //// [2.ts] -import foo from "./1"; -import foo1 from "./11"; +import foo from './1'; +import foo1 from './11'; foo.a, foo1.a, foo.b, foo1.b; diff --git a/crates/swc/tests/tsc-references/exportAsNamespace_nonExistent.1.normal.js b/crates/swc/tests/tsc-references/exportAsNamespace_nonExistent.1.normal.js index a7db36f3dfc4..aa2b4d051dab 100644 --- a/crates/swc/tests/tsc-references/exportAsNamespace_nonExistent.1.normal.js +++ b/crates/swc/tests/tsc-references/exportAsNamespace_nonExistent.1.normal.js @@ -1,3 +1,3 @@ //// [exportAsNamespace_nonExistent.ts] -import * as _ns from "./nonexistent"; // Error +import * as _ns from './nonexistent'; // Error export { _ns as ns }; diff --git a/crates/swc/tests/tsc-references/exportAsNamespace_nonExistent.2.minified.js b/crates/swc/tests/tsc-references/exportAsNamespace_nonExistent.2.minified.js index 8e561a85025c..d4e4d61dd289 100644 --- a/crates/swc/tests/tsc-references/exportAsNamespace_nonExistent.2.minified.js +++ b/crates/swc/tests/tsc-references/exportAsNamespace_nonExistent.2.minified.js @@ -1,3 +1,3 @@ //// [exportAsNamespace_nonExistent.ts] -import * as _ns from "./nonexistent"; +import * as _ns from './nonexistent'; export { _ns as ns }; diff --git a/crates/swc/tests/tsc-references/exportBinding.1.normal.js b/crates/swc/tests/tsc-references/exportBinding.1.normal.js index f09c5457ea8b..a78ce7168ddc 100644 --- a/crates/swc/tests/tsc-references/exportBinding.1.normal.js +++ b/crates/swc/tests/tsc-references/exportBinding.1.normal.js @@ -3,7 +3,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; export { x }; export { x as xx }; export default x; -var x = "x"; +var x = 'x'; export { Y as Z }; var Y = function Y() { "use strict"; @@ -13,4 +13,4 @@ var Y = function Y() { export { y }; export { y as yy }; export default y; -var y = "y"; +var y = 'y'; diff --git a/crates/swc/tests/tsc-references/exportBinding.2.minified.js b/crates/swc/tests/tsc-references/exportBinding.2.minified.js index 40d42a7c0325..e229c51a99c8 100644 --- a/crates/swc/tests/tsc-references/exportBinding.2.minified.js +++ b/crates/swc/tests/tsc-references/exportBinding.2.minified.js @@ -1,12 +1,12 @@ //// [exportConsts.ts] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; export default x; -var x = "x"; +var x = 'x'; var Y = function Y() { _class_call_check(this, Y); }; export { x, x as xx, Y as Z }; //// [exportVars.ts] export default y; -var y = "y"; +var y = 'y'; export { y, y as yy }; diff --git a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier.1.normal.js b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier.1.normal.js index 22b6f9f0bb89..0eb991d1072a 100644 --- a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier.1.normal.js +++ b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier.1.normal.js @@ -7,5 +7,5 @@ export var A = function A() { //// [/b.ts] export { }; //// [/c.ts] -import { A } from "./b"; +import { A } from './b'; new A(); diff --git a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier.2.minified.js b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier.2.minified.js index 8b0c870e821e..4ca5830afaa1 100644 --- a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier.2.minified.js +++ b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier.2.minified.js @@ -6,5 +6,5 @@ export var A = function A() { //// [/b.ts] export { }; //// [/c.ts] -import { A } from "./b"; +import { A } from './b'; new A(); diff --git a/crates/swc/tests/tsc-references/exportDefaultNamespace.1.normal.js b/crates/swc/tests/tsc-references/exportDefaultNamespace.1.normal.js index 398492f394a7..a777e0bd72b3 100644 --- a/crates/swc/tests/tsc-references/exportDefaultNamespace.1.normal.js +++ b/crates/swc/tests/tsc-references/exportDefaultNamespace.1.normal.js @@ -1,5 +1,5 @@ //// [exportDefaultNamespace.ts] export default function someFunc() { - return "hello!"; + return 'hello!'; } -someFunc.someProp = "yo"; +someFunc.someProp = 'yo'; diff --git a/crates/swc/tests/tsc-references/exportDefaultNamespace.2.minified.js b/crates/swc/tests/tsc-references/exportDefaultNamespace.2.minified.js index 398492f394a7..a777e0bd72b3 100644 --- a/crates/swc/tests/tsc-references/exportDefaultNamespace.2.minified.js +++ b/crates/swc/tests/tsc-references/exportDefaultNamespace.2.minified.js @@ -1,5 +1,5 @@ //// [exportDefaultNamespace.ts] export default function someFunc() { - return "hello!"; + return 'hello!'; } -someFunc.someProp = "yo"; +someFunc.someProp = 'yo'; diff --git a/crates/swc/tests/tsc-references/exportImportAlias.1.normal.js b/crates/swc/tests/tsc-references/exportImportAlias.1.normal.js index a8aa8e18c0f7..0b20ad3676d1 100644 --- a/crates/swc/tests/tsc-references/exportImportAlias.1.normal.js +++ b/crates/swc/tests/tsc-references/exportImportAlias.1.normal.js @@ -3,7 +3,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var A; (function(A) { - A.x = "hello world"; + A.x = 'hello world'; var Point = function Point(x, y) { "use strict"; _class_call_check(this, Point); @@ -60,6 +60,6 @@ var M; M.D = K.L; })(M || (M = {})); var o; -var o = new M.D("Hello"); +var o = new M.D('Hello'); var p; var p; diff --git a/crates/swc/tests/tsc-references/exportImportAlias.2.minified.js b/crates/swc/tests/tsc-references/exportImportAlias.2.minified.js index c366602fffd7..045e06badb65 100644 --- a/crates/swc/tests/tsc-references/exportImportAlias.2.minified.js +++ b/crates/swc/tests/tsc-references/exportImportAlias.2.minified.js @@ -1,7 +1,7 @@ //// [exportImportAlias.ts] var A, C, X, Z, K, M, A1, K1, L; import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; -(A1 = A || (A = {})).x = "hello world", A1.Point = function Point(x, y) { +(A1 = A || (A = {})).x = 'hello world', A1.Point = function Point(x, y) { _class_call_check(this, Point), this.x = x, this.y = y; }, (C || (C = {})).a = A, C.a.x, new C.a.Point(0, 0), function(X) { function Y() { @@ -12,4 +12,4 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; }; }(X || (X = {})), (Z || (Z = {})).y = X.Y, Z.y(), new Z.y.Point(0, 0), K1 = K || (K = {}), L = function L(name) { _class_call_check(this, L), this.name = name; -}, K1.L = L, (L = K1.L || (K1.L = {})).y = 12, (M || (M = {})).D = K.L, new M.D("Hello"); +}, K1.L = L, (L = K1.L || (K1.L = {})).y = 12, (M || (M = {})).D = K.L, new M.D('Hello'); diff --git a/crates/swc/tests/tsc-references/exportNamespace1.1.normal.js b/crates/swc/tests/tsc-references/exportNamespace1.1.normal.js index 412f238fddf2..d172ad0cbfb8 100644 --- a/crates/swc/tests/tsc-references/exportNamespace1.1.normal.js +++ b/crates/swc/tests/tsc-references/exportNamespace1.1.normal.js @@ -7,7 +7,7 @@ export var A = function A() { //// [b.ts] export { }; //// [c.ts] -export * from "./b"; +export * from './b'; //// [d.ts] -import { A } from "./c"; +import { A } from './c'; new A(); // Error diff --git a/crates/swc/tests/tsc-references/exportNamespace1.2.minified.js b/crates/swc/tests/tsc-references/exportNamespace1.2.minified.js index 20c23c59d388..eca7676244dc 100644 --- a/crates/swc/tests/tsc-references/exportNamespace1.2.minified.js +++ b/crates/swc/tests/tsc-references/exportNamespace1.2.minified.js @@ -6,7 +6,7 @@ export var A = function A() { //// [b.ts] export { }; //// [c.ts] -export * from "./b"; +export * from './b'; //// [d.ts] -import { A } from "./c"; +import { A } from './c'; new A(); diff --git a/crates/swc/tests/tsc-references/exportNamespace11.1.normal.js b/crates/swc/tests/tsc-references/exportNamespace11.1.normal.js index 595160052d0b..d846a8527aea 100644 --- a/crates/swc/tests/tsc-references/exportNamespace11.1.normal.js +++ b/crates/swc/tests/tsc-references/exportNamespace11.1.normal.js @@ -1,5 +1,5 @@ //// [main.ts] -import * as intermediate from "./intermediate"; +import * as intermediate from './intermediate'; var ghost = new intermediate.Ghost(); //// [intermediate.ts] export { }; diff --git a/crates/swc/tests/tsc-references/exportNamespace11.2.minified.js b/crates/swc/tests/tsc-references/exportNamespace11.2.minified.js index 449e76dc98b3..cf4142d4490b 100644 --- a/crates/swc/tests/tsc-references/exportNamespace11.2.minified.js +++ b/crates/swc/tests/tsc-references/exportNamespace11.2.minified.js @@ -1,5 +1,5 @@ //// [main.ts] -import * as intermediate from "./intermediate"; +import * as intermediate from './intermediate'; new intermediate.Ghost(); //// [intermediate.ts] export { }; diff --git a/crates/swc/tests/tsc-references/exportNamespace12.1.normal.js b/crates/swc/tests/tsc-references/exportNamespace12.1.normal.js index fa35dee3de0b..96ee10309ea9 100644 --- a/crates/swc/tests/tsc-references/exportNamespace12.1.normal.js +++ b/crates/swc/tests/tsc-references/exportNamespace12.1.normal.js @@ -1,6 +1,6 @@ //// [main.ts] -import { c } from "./types"; -import * as types from "./types"; +import { c } from './types'; +import * as types from './types'; console.log(c) // Fails as expected, import is still allowed though. ; console.log(types.c) // Expected an error here. diff --git a/crates/swc/tests/tsc-references/exportNamespace12.2.minified.js b/crates/swc/tests/tsc-references/exportNamespace12.2.minified.js index c98294be5a64..e52823de6318 100644 --- a/crates/swc/tests/tsc-references/exportNamespace12.2.minified.js +++ b/crates/swc/tests/tsc-references/exportNamespace12.2.minified.js @@ -1,6 +1,6 @@ //// [main.ts] -import { c } from "./types"; -import * as types from "./types"; +import { c } from './types'; +import * as types from './types'; console.log(c), console.log(types.c); //// [types.ts] export { }; diff --git a/crates/swc/tests/tsc-references/exportNamespace3.1.normal.js b/crates/swc/tests/tsc-references/exportNamespace3.1.normal.js index 1ba2b1ffc668..49783e733c74 100644 --- a/crates/swc/tests/tsc-references/exportNamespace3.1.normal.js +++ b/crates/swc/tests/tsc-references/exportNamespace3.1.normal.js @@ -7,8 +7,8 @@ export var A = function A() { //// [b.ts] export { }; //// [c.ts] -import * as _a from "./b"; +import * as _a from './b'; export { _a as a }; //// [d.ts] -import { a } from "./c"; +import { a } from './c'; new a.A(); // Error diff --git a/crates/swc/tests/tsc-references/exportNamespace3.2.minified.js b/crates/swc/tests/tsc-references/exportNamespace3.2.minified.js index c944481cb8f8..ce6bd697e412 100644 --- a/crates/swc/tests/tsc-references/exportNamespace3.2.minified.js +++ b/crates/swc/tests/tsc-references/exportNamespace3.2.minified.js @@ -6,8 +6,8 @@ export var A = function A() { //// [b.ts] export { }; //// [c.ts] -import * as _a from "./b"; +import * as _a from './b'; export { _a as a }; //// [d.ts] -import { a } from "./c"; +import { a } from './c'; new a.A(); diff --git a/crates/swc/tests/tsc-references/exportNamespace4.1.normal.js b/crates/swc/tests/tsc-references/exportNamespace4.1.normal.js index 1340d8ceb168..2d1e11a552cf 100644 --- a/crates/swc/tests/tsc-references/exportNamespace4.1.normal.js +++ b/crates/swc/tests/tsc-references/exportNamespace4.1.normal.js @@ -10,8 +10,8 @@ export { }; //// [c.ts] export { }; //// [d.ts] -import { A } from "./b"; +import { A } from './b'; A; //// [e.ts] -import { ns } from "./c"; +import { ns } from './c'; ns.A; diff --git a/crates/swc/tests/tsc-references/exportNamespace4.2.minified.js b/crates/swc/tests/tsc-references/exportNamespace4.2.minified.js index e9f0d93b0087..6d76a5babccb 100644 --- a/crates/swc/tests/tsc-references/exportNamespace4.2.minified.js +++ b/crates/swc/tests/tsc-references/exportNamespace4.2.minified.js @@ -9,7 +9,7 @@ export { }; //// [c.ts] export { }; //// [d.ts] -import { A } from "./b"; +import { A } from './b'; //// [e.ts] -import { ns } from "./c"; +import { ns } from './c'; ns.A; diff --git a/crates/swc/tests/tsc-references/exportNamespace_js.1.normal.js b/crates/swc/tests/tsc-references/exportNamespace_js.1.normal.js index 990f92b0c274..3c1d6eb66ec5 100644 --- a/crates/swc/tests/tsc-references/exportNamespace_js.1.normal.js +++ b/crates/swc/tests/tsc-references/exportNamespace_js.1.normal.js @@ -8,5 +8,5 @@ export var A = function A() { //// [b.js] export { }; //// [c.js] -import { A } from "./b"; +import { A } from './b'; A; diff --git a/crates/swc/tests/tsc-references/exportNamespace_js.2.minified.js b/crates/swc/tests/tsc-references/exportNamespace_js.2.minified.js index bd522676dc7b..da1ab40f8c67 100644 --- a/crates/swc/tests/tsc-references/exportNamespace_js.2.minified.js +++ b/crates/swc/tests/tsc-references/exportNamespace_js.2.minified.js @@ -7,4 +7,4 @@ export var A = function A() { //// [b.js] export { }; //// [c.js] -import { A } from "./b"; +import { A } from './b'; diff --git a/crates/swc/tests/tsc-references/exportNestedNamespaces.1.normal.js b/crates/swc/tests/tsc-references/exportNestedNamespaces.1.normal.js index 2a012a2ad5aa..2920c9ef8f15 100644 --- a/crates/swc/tests/tsc-references/exportNestedNamespaces.1.normal.js +++ b/crates/swc/tests/tsc-references/exportNestedNamespaces.1.normal.js @@ -10,7 +10,7 @@ exports.Classic = function _class() { this.p = 1; }; //// [use.js] -import * as s from "./mod"; +import * as s from './mod'; var k = new s.n.K(); k.x; var classic = new s.Classic(); diff --git a/crates/swc/tests/tsc-references/exportNestedNamespaces.2.minified.js b/crates/swc/tests/tsc-references/exportNestedNamespaces.2.minified.js index 581d8922313a..bd95264260c7 100644 --- a/crates/swc/tests/tsc-references/exportNestedNamespaces.2.minified.js +++ b/crates/swc/tests/tsc-references/exportNestedNamespaces.2.minified.js @@ -6,5 +6,5 @@ exports.n = {}, exports.n.K = function() { _class_call_check(this, _class), this.p = 1; }; //// [use.js] -import * as s from "./mod"; +import * as s from './mod'; new s.n.K().x, new s.Classic(); diff --git a/crates/swc/tests/tsc-references/exportNestedNamespaces2.1.normal.js b/crates/swc/tests/tsc-references/exportNestedNamespaces2.1.normal.js index 0d49161d785b..b77d45b708c8 100644 --- a/crates/swc/tests/tsc-references/exportNestedNamespaces2.1.normal.js +++ b/crates/swc/tests/tsc-references/exportNestedNamespaces2.1.normal.js @@ -3,16 +3,16 @@ // Based on a pattern from adonis exports.formatters = {}; //// [first.js] -exports = require("./mod"); +exports = require('./mod'); exports.formatters.j = function(v) { return v; }; //// [second.js] -exports = require("./mod"); +exports = require('./mod'); exports.formatters.o = function(v) { return v; }; //// [use.js] -import * as debug from "./mod"; +import * as debug from './mod'; debug.formatters.j; var one = debug.formatters.o(1); diff --git a/crates/swc/tests/tsc-references/exportNestedNamespaces2.2.minified.js b/crates/swc/tests/tsc-references/exportNestedNamespaces2.2.minified.js index 5d4a1cca6836..02548f35554c 100644 --- a/crates/swc/tests/tsc-references/exportNestedNamespaces2.2.minified.js +++ b/crates/swc/tests/tsc-references/exportNestedNamespaces2.2.minified.js @@ -2,13 +2,13 @@ //// [mod.js] exports.formatters = {}; //// [first.js] -(exports = require("./mod")).formatters.j = function(v) { +(exports = require('./mod')).formatters.j = function(v) { return v; }; //// [second.js] -(exports = require("./mod")).formatters.o = function(v) { +(exports = require('./mod')).formatters.o = function(v) { return v; }; //// [use.js] -import * as debug from "./mod"; +import * as debug from './mod'; debug.formatters.j, debug.formatters.o(1); diff --git a/crates/swc/tests/tsc-references/exportedAliasedEnumTag.1.normal.js b/crates/swc/tests/tsc-references/exportedAliasedEnumTag.1.normal.js index a85d5caa81c4..4e3a9b106659 100644 --- a/crates/swc/tests/tsc-references/exportedAliasedEnumTag.1.normal.js +++ b/crates/swc/tests/tsc-references/exportedAliasedEnumTag.1.normal.js @@ -1,5 +1,5 @@ //// [exportedAliasedEnumTag.js] var middlewarify = module.exports = {}; /** @enum */ middlewarify.Type = { - BEFORE: "before" + BEFORE: 'before' }; diff --git a/crates/swc/tests/tsc-references/exportedAliasedEnumTag.2.minified.js b/crates/swc/tests/tsc-references/exportedAliasedEnumTag.2.minified.js index 429c0fa9aaf0..6709e31b4a38 100644 --- a/crates/swc/tests/tsc-references/exportedAliasedEnumTag.2.minified.js +++ b/crates/swc/tests/tsc-references/exportedAliasedEnumTag.2.minified.js @@ -1,4 +1,4 @@ //// [exportedAliasedEnumTag.js] (module.exports = {}).Type = { - BEFORE: "before" + BEFORE: 'before' }; diff --git a/crates/swc/tests/tsc-references/extendBooleanInterface.1.normal.js b/crates/swc/tests/tsc-references/extendBooleanInterface.1.normal.js index 7bbb6ca70325..1b620b204dd8 100644 --- a/crates/swc/tests/tsc-references/extendBooleanInterface.1.normal.js +++ b/crates/swc/tests/tsc-references/extendBooleanInterface.1.normal.js @@ -1,6 +1,6 @@ //// [extendBooleanInterface.ts] var x = true; var a = x.doStuff(); -var b = x.doOtherStuff("hm"); -var c = x["doStuff"](); -var d = x["doOtherStuff"]("hm"); +var b = x.doOtherStuff('hm'); +var c = x['doStuff'](); +var d = x['doOtherStuff']('hm'); diff --git a/crates/swc/tests/tsc-references/extendBooleanInterface.2.minified.js b/crates/swc/tests/tsc-references/extendBooleanInterface.2.minified.js index 1fa7be9e27ca..969c7b147336 100644 --- a/crates/swc/tests/tsc-references/extendBooleanInterface.2.minified.js +++ b/crates/swc/tests/tsc-references/extendBooleanInterface.2.minified.js @@ -1,2 +1,2 @@ //// [extendBooleanInterface.ts] -(!0).doStuff(), (!0).doOtherStuff("hm"), (!0).doStuff(), (!0).doOtherStuff("hm"); +(!0).doStuff(), (!0).doOtherStuff('hm'), (!0).doStuff(), (!0).doOtherStuff('hm'); diff --git a/crates/swc/tests/tsc-references/extendNumberInterface.1.normal.js b/crates/swc/tests/tsc-references/extendNumberInterface.1.normal.js index f021e1045054..71397b0c3626 100644 --- a/crates/swc/tests/tsc-references/extendNumberInterface.1.normal.js +++ b/crates/swc/tests/tsc-references/extendNumberInterface.1.normal.js @@ -1,6 +1,6 @@ //// [extendNumberInterface.ts] var x = 1; var a = x.doStuff(); -var b = x.doOtherStuff("hm"); -var c = x["doStuff"](); -var d = x["doOtherStuff"]("hm"); +var b = x.doOtherStuff('hm'); +var c = x['doStuff'](); +var d = x['doOtherStuff']('hm'); diff --git a/crates/swc/tests/tsc-references/extendNumberInterface.2.minified.js b/crates/swc/tests/tsc-references/extendNumberInterface.2.minified.js index 9ba9b386b901..c84aa399ee84 100644 --- a/crates/swc/tests/tsc-references/extendNumberInterface.2.minified.js +++ b/crates/swc/tests/tsc-references/extendNumberInterface.2.minified.js @@ -1,2 +1,2 @@ //// [extendNumberInterface.ts] -1..doStuff(), 1..doOtherStuff("hm"), 1..doStuff(), 1..doOtherStuff("hm"); +1..doStuff(), 1..doOtherStuff('hm'), 1..doStuff(), 1..doOtherStuff('hm'); diff --git a/crates/swc/tests/tsc-references/extendStringInterface.1.normal.js b/crates/swc/tests/tsc-references/extendStringInterface.1.normal.js index 0031e17d4b58..58a433dd9f74 100644 --- a/crates/swc/tests/tsc-references/extendStringInterface.1.normal.js +++ b/crates/swc/tests/tsc-references/extendStringInterface.1.normal.js @@ -1,6 +1,6 @@ //// [extendStringInterface.ts] -var x = ""; +var x = ''; var a = x.doStuff(); -var b = x.doOtherStuff("hm"); -var c = x["doStuff"](); -var d = x["doOtherStuff"]("hm"); +var b = x.doOtherStuff('hm'); +var c = x['doStuff'](); +var d = x['doOtherStuff']('hm'); diff --git a/crates/swc/tests/tsc-references/extendStringInterface.2.minified.js b/crates/swc/tests/tsc-references/extendStringInterface.2.minified.js index 145239eec21a..bf3bc7f059a0 100644 --- a/crates/swc/tests/tsc-references/extendStringInterface.2.minified.js +++ b/crates/swc/tests/tsc-references/extendStringInterface.2.minified.js @@ -1,2 +1,2 @@ //// [extendStringInterface.ts] -"".doStuff(), "".doOtherStuff("hm"), "".doStuff(), "".doOtherStuff("hm"); +''.doStuff(), ''.doOtherStuff('hm'), ''.doStuff(), ''.doOtherStuff('hm'); diff --git a/crates/swc/tests/tsc-references/filterNamespace_import.1.normal.js b/crates/swc/tests/tsc-references/filterNamespace_import.1.normal.js index a6db0ead817a..0080bd1d75dd 100644 --- a/crates/swc/tests/tsc-references/filterNamespace_import.1.normal.js +++ b/crates/swc/tests/tsc-references/filterNamespace_import.1.normal.js @@ -24,6 +24,6 @@ ns.Value; // Error var c; var t = ""; var n = { - a: "" + a: '' }; export { }; diff --git a/crates/swc/tests/tsc-references/fixSignatureCaching.1.normal.js b/crates/swc/tests/tsc-references/fixSignatureCaching.1.normal.js index 8cc0a9db1620..57401bd90585 100644 --- a/crates/swc/tests/tsc-references/fixSignatureCaching.1.normal.js +++ b/crates/swc/tests/tsc-references/fixSignatureCaching.1.normal.js @@ -3,7 +3,7 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; // Repro from #10697 (function(define1, undefined) { define1(function() { - "use strict"; + 'use strict'; var impl = {}; impl.mobileDetectRules = { "phones": { @@ -159,18 +159,18 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; "iOS": "\\biPhone.*Mobile|\\biPod|\\biPad", "MeeGoOS": "MeeGo", "MaemoOS": "Maemo", - "JavaOS": "J2ME/|\\bMIDP\\b|\\bCLDC\\b", + "JavaOS": "J2ME\/|\\bMIDP\\b|\\bCLDC\\b", "webOS": "webOS|hpwOS", "badaOS": "\\bBada\\b", "BREWOS": "BREW" }, "uas": { "Vivaldi": "Vivaldi", - "Chrome": "\\bCrMo\\b|CriOS|Android.*Chrome/[.0-9]* (Mobile)?", + "Chrome": "\\bCrMo\\b|CriOS|Android.*Chrome\/[.0-9]* (Mobile)?", "Dolfin": "\\bDolfin\\b", - "Opera": "Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR/[0-9.]+|Coast/[0-9.]+", + "Opera": "Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR\/[0-9.]+|Coast\/[0-9.]+", "Skyfire": "Skyfire", - "Edge": "Mobile Safari/[.0-9]* Edge", + "Edge": "Mobile Safari\/[.0-9]* Edge", "IE": "IEMobile|MSIEMobile", "Firefox": "fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile", "Bolt": "bolt", @@ -190,90 +190,90 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; "PaleMoon": "Android.*PaleMoon|Mobile.*PaleMoon" }, "props": { - "Mobile": "Mobile/[VER]", - "Build": "Build/[VER]", - "Version": "Version/[VER]", - "VendorID": "VendorID/[VER]", + "Mobile": "Mobile\/[VER]", + "Build": "Build\/[VER]", + "Version": "Version\/[VER]", + "VendorID": "VendorID\/[VER]", "iPad": "iPad.*CPU[a-z ]+[VER]", "iPhone": "iPhone.*CPU[a-z ]+[VER]", "iPod": "iPod.*CPU[a-z ]+[VER]", - "Kindle": "Kindle/[VER]", + "Kindle": "Kindle\/[VER]", "Chrome": [ - "Chrome/[VER]", - "CriOS/[VER]", - "CrMo/[VER]" + "Chrome\/[VER]", + "CriOS\/[VER]", + "CrMo\/[VER]" ], "Coast": [ - "Coast/[VER]" + "Coast\/[VER]" ], - "Dolfin": "Dolfin/[VER]", - "Firefox": "Firefox/[VER]", - "Fennec": "Fennec/[VER]", - "Edge": "Edge/[VER]", + "Dolfin": "Dolfin\/[VER]", + "Firefox": "Firefox\/[VER]", + "Fennec": "Fennec\/[VER]", + "Edge": "Edge\/[VER]", "IE": [ - "IEMobile/[VER];", + "IEMobile\/[VER];", "IEMobile [VER]", "MSIE [VER];", - "Trident/[0-9.]+;.*rv:[VER]" + "Trident\/[0-9.]+;.*rv:[VER]" ], - "NetFront": "NetFront/[VER]", - "NokiaBrowser": "NokiaBrowser/[VER]", + "NetFront": "NetFront\/[VER]", + "NokiaBrowser": "NokiaBrowser\/[VER]", "Opera": [ - " OPR/[VER]", - "Opera Mini/[VER]", - "Version/[VER]" + " OPR\/[VER]", + "Opera Mini\/[VER]", + "Version\/[VER]" ], - "Opera Mini": "Opera Mini/[VER]", - "Opera Mobi": "Version/[VER]", + "Opera Mini": "Opera Mini\/[VER]", + "Opera Mobi": "Version\/[VER]", "UC Browser": "UC Browser[VER]", - "MQQBrowser": "MQQBrowser/[VER]", - "MicroMessenger": "MicroMessenger/[VER]", - "baiduboxapp": "baiduboxapp/[VER]", - "baidubrowser": "baidubrowser/[VER]", - "Iron": "Iron/[VER]", + "MQQBrowser": "MQQBrowser\/[VER]", + "MicroMessenger": "MicroMessenger\/[VER]", + "baiduboxapp": "baiduboxapp\/[VER]", + "baidubrowser": "baidubrowser\/[VER]", + "Iron": "Iron\/[VER]", "Safari": [ - "Version/[VER]", - "Safari/[VER]" + "Version\/[VER]", + "Safari\/[VER]" ], - "Skyfire": "Skyfire/[VER]", - "Tizen": "Tizen/[VER]", - "Webkit": "webkit[ /][VER]", - "PaleMoon": "PaleMoon/[VER]", - "Gecko": "Gecko/[VER]", - "Trident": "Trident/[VER]", - "Presto": "Presto/[VER]", - "Goanna": "Goanna/[VER]", + "Skyfire": "Skyfire\/[VER]", + "Tizen": "Tizen\/[VER]", + "Webkit": "webkit[ \/][VER]", + "PaleMoon": "PaleMoon\/[VER]", + "Gecko": "Gecko\/[VER]", + "Trident": "Trident\/[VER]", + "Presto": "Presto\/[VER]", + "Goanna": "Goanna\/[VER]", "iOS": " \\bi?OS\\b [VER][ ;]{1}", "Android": "Android [VER]", "BlackBerry": [ - "BlackBerry[\\w]+/[VER]", - "BlackBerry.*Version/[VER]", - "Version/[VER]" + "BlackBerry[\\w]+\/[VER]", + "BlackBerry.*Version\/[VER]", + "Version\/[VER]" ], "BREW": "BREW [VER]", - "Java": "Java/[VER]", + "Java": "Java\/[VER]", "Windows Phone OS": [ "Windows Phone OS [VER]", "Windows Phone [VER]" ], "Windows Phone": "Windows Phone [VER]", - "Windows CE": "Windows CE/[VER]", + "Windows CE": "Windows CE\/[VER]", "Windows NT": "Windows NT [VER]", "Symbian": [ - "SymbianOS/[VER]", - "Symbian/[VER]" + "SymbianOS\/[VER]", + "Symbian\/[VER]" ], "webOS": [ - "webOS/[VER]", - "hpwOS/[VER];" + "webOS\/[VER]", + "hpwOS\/[VER];" ] }, "utils": { "Bot": "Googlebot|facebookexternalhit|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|Exabot|MJ12bot|YandexImages|TurnitinBot|Pingdom", - "MobileBot": "Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker/M1A1-R2D2", + "MobileBot": "Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker\/M1A1-R2D2", "DesktopMode": "WPDesktop", "TV": "SonyDTV|HbbTV", - "WebKit": "(webkit)[ /]([\\w.]+)", + "WebKit": "(webkit)[ \/]([\\w.]+)", "Console": "\\b(Nintendo|Nintendo WiiU|Nintendo 3DS|PLAYSTATION|Xbox)\\b", "Watch": "SM-V700" } @@ -285,14 +285,14 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; tabletPattern: /android|ipad|playbook|silk/i }; var hasOwnProp = Object.prototype.hasOwnProperty, isArray; - impl.FALLBACK_PHONE = "UnknownPhone"; - impl.FALLBACK_TABLET = "UnknownTablet"; - impl.FALLBACK_MOBILE = "UnknownMobile"; - isArray = "isArray" in Array ? Array.isArray : function isArray(value) { - return Object.prototype.toString.call(value) === "[object Array]"; + impl.FALLBACK_PHONE = 'UnknownPhone'; + impl.FALLBACK_TABLET = 'UnknownTablet'; + impl.FALLBACK_MOBILE = 'UnknownMobile'; + isArray = 'isArray' in Array ? Array.isArray : function isArray(value) { + return Object.prototype.toString.call(value) === '[object Array]'; }; - isArray = "isArray" in Array ? function isArray(value) { - return Object.prototype.toString.call(value) === "[object Array]"; + isArray = 'isArray' in Array ? function isArray(value) { + return Object.prototype.toString.call(value) === '[object Array]'; } : Array.isArray; function equalIC(a, b) { return a != null && b != null && a.toLowerCase() === b.toLowerCase(); @@ -313,7 +313,7 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; function convertPropsToRegExp(object) { for(var key in object){ if (hasOwnProp.call(object, key)) { - object[key] = new RegExp(object[key], "i"); + object[key] = new RegExp(object[key], 'i'); } } } @@ -330,11 +330,11 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; len = values.length; for(i = 0; i < len; ++i){ value = values[i]; - verPos = value.indexOf("[VER]"); + verPos = value.indexOf('[VER]'); if (verPos >= 0) { - value = value.substring(0, verPos) + "([\\w._\\+]+)" + value.substring(verPos + 5); + value = value.substring(0, verPos) + '([\\w._\\+]+)' + value.substring(verPos + 5); } - values[i] = new RegExp(value, "i"); + values[i] = new RegExp(value, 'i'); } mobileDetectRules.props[key] = values; } @@ -429,9 +429,9 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; version = numbers[0]; } if (numbers.length > 1) { - version = numbers[0] + "."; + version = numbers[0] + '.'; numbers.shift(); - version += numbers.join(""); + version += numbers.join(''); } return Number(version); }; @@ -492,51 +492,51 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; // [reg] / (nothing) <-- jsdelivr complaining about unescaped unicode character U+00AE var $isMobile = t.mobile() !== null; if (// Apple iOS 3.2-5.1 - Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3), iPad 3 (5.1), original iPhone (3.1), iPhone 3 (3.2), 3GS (4.3), 4 (4.3 / 5.0), and 4S (5.1) - t.os("iOS") && t.version("iPad") >= 4.3 || t.os("iOS") && t.version("iPhone") >= 3.1 || t.os("iOS") && t.version("iPod") >= 3.1 || // Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5) + t.os('iOS') && t.version('iPad') >= 4.3 || t.os('iOS') && t.version('iPhone') >= 3.1 || t.os('iOS') && t.version('iPod') >= 3.1 || // Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5) // Android 3.1 (Honeycomb) - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM // Android 4.0 (ICS) - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices // Android 4.1 (Jelly Bean) - Tested on a Galaxy Nexus and Galaxy 7 - t.version("Android") > 2.1 && t.is("Webkit") || // Windows Phone 7-7.5 - Tested on the HTC Surround (7.0) HTC Trophy (7.5), LG-E900 (7.5), Nokia Lumia 800 - t.version("Windows Phone OS") >= 7.0 || // Blackberry 7 - Tested on BlackBerry Torch 9810 + t.version('Android') > 2.1 && t.is('Webkit') || // Windows Phone 7-7.5 - Tested on the HTC Surround (7.0) HTC Trophy (7.5), LG-E900 (7.5), Nokia Lumia 800 + t.version('Windows Phone OS') >= 7.0 || // Blackberry 7 - Tested on BlackBerry Torch 9810 // Blackberry 6.0 - Tested on the Torch 9800 and Style 9670 - t.is("BlackBerry") && t.version("BlackBerry") >= 6.0 || // Blackberry Playbook (1.0-2.0) - Tested on PlayBook - t.match("Playbook.*Tablet") || // Palm WebOS (1.4-2.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0) - t.version("webOS") >= 1.4 && t.match("Palm|Pre|Pixi") || // Palm WebOS 3.0 - Tested on HP TouchPad - t.match("hp.*TouchPad") || // Firefox Mobile (12 Beta) - Tested on Android 2.3 device - t.is("Firefox") && t.version("Firefox") >= 12 || // Chrome for Android - Tested on Android 4.0, 4.1 device - t.is("Chrome") && t.is("AndroidOS") && t.version("Android") >= 4.0 || // Skyfire 4.1 - Tested on Android 2.3 device - t.is("Skyfire") && t.version("Skyfire") >= 4.1 && t.is("AndroidOS") && t.version("Android") >= 2.3 || // Opera Mobile 11.5-12: Tested on Android 2.3 - t.is("Opera") && t.version("Opera Mobi") > 11 && t.is("AndroidOS") || // Meego 1.2 - Tested on Nokia 950 and N9 - t.is("MeeGoOS") || // Tizen (pre-release) - Tested on early hardware - t.is("Tizen") || // Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser + t.is('BlackBerry') && t.version('BlackBerry') >= 6.0 || // Blackberry Playbook (1.0-2.0) - Tested on PlayBook + t.match('Playbook.*Tablet') || // Palm WebOS (1.4-2.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0) + t.version('webOS') >= 1.4 && t.match('Palm|Pre|Pixi') || // Palm WebOS 3.0 - Tested on HP TouchPad + t.match('hp.*TouchPad') || // Firefox Mobile (12 Beta) - Tested on Android 2.3 device + t.is('Firefox') && t.version('Firefox') >= 12 || // Chrome for Android - Tested on Android 4.0, 4.1 device + t.is('Chrome') && t.is('AndroidOS') && t.version('Android') >= 4.0 || // Skyfire 4.1 - Tested on Android 2.3 device + t.is('Skyfire') && t.version('Skyfire') >= 4.1 && t.is('AndroidOS') && t.version('Android') >= 2.3 || // Opera Mobile 11.5-12: Tested on Android 2.3 + t.is('Opera') && t.version('Opera Mobi') > 11 && t.is('AndroidOS') || // Meego 1.2 - Tested on Nokia 950 and N9 + t.is('MeeGoOS') || // Tizen (pre-release) - Tested on early hardware + t.is('Tizen') || // Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser // @todo: more tests here! - t.is("Dolfin") && t.version("Bada") >= 2.0 || // UC Browser - Tested on Android 2.3 device - (t.is("UC Browser") || t.is("Dolfin")) && t.version("Android") >= 2.3 || // Kindle 3 and Fire - Tested on the built-in WebKit browser for each - t.match("Kindle Fire") || t.is("Kindle") && t.version("Kindle") >= 3.0 || // Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet - t.is("AndroidOS") && t.is("NookTablet") || // Chrome Desktop 11-21 - Tested on OS X 10.7 and Windows 7 - t.version("Chrome") >= 11 && !$isMobile || // Safari Desktop 4-5 - Tested on OS X 10.7 and Windows 7 - t.version("Safari") >= 5.0 && !$isMobile || // Firefox Desktop 4-13 - Tested on OS X 10.7 and Windows 7 - t.version("Firefox") >= 4.0 && !$isMobile || // Internet Explorer 7-9 - Tested on Windows XP, Vista and 7 - t.version("MSIE") >= 7.0 && !$isMobile || // Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7 + t.is('Dolfin') && t.version('Bada') >= 2.0 || // UC Browser - Tested on Android 2.3 device + (t.is('UC Browser') || t.is('Dolfin')) && t.version('Android') >= 2.3 || // Kindle 3 and Fire - Tested on the built-in WebKit browser for each + t.match('Kindle Fire') || t.is('Kindle') && t.version('Kindle') >= 3.0 || // Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet + t.is('AndroidOS') && t.is('NookTablet') || // Chrome Desktop 11-21 - Tested on OS X 10.7 and Windows 7 + t.version('Chrome') >= 11 && !$isMobile || // Safari Desktop 4-5 - Tested on OS X 10.7 and Windows 7 + t.version('Safari') >= 5.0 && !$isMobile || // Firefox Desktop 4-13 - Tested on OS X 10.7 and Windows 7 + t.version('Firefox') >= 4.0 && !$isMobile || // Internet Explorer 7-9 - Tested on Windows XP, Vista and 7 + t.version('MSIE') >= 7.0 && !$isMobile || // Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7 // @reference: http://my.opera.com/community/openweb/idopera/ - t.version("Opera") >= 10 && !$isMobile) { - return "A"; + t.version('Opera') >= 10 && !$isMobile) { + return 'A'; } - if (t.os("iOS") && t.version("iPad") < 4.3 || t.os("iOS") && t.version("iPhone") < 3.1 || t.os("iOS") && t.version("iPod") < 3.1 || // Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770 - t.is("Blackberry") && t.version("BlackBerry") >= 5 && t.version("BlackBerry") < 6 || //Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3 - t.version("Opera Mini") >= 5.0 && t.version("Opera Mini") <= 6.5 && (t.version("Android") >= 2.3 || t.is("iOS")) || // Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1) - t.match("NokiaN8|NokiaC7|N97.*Series60|Symbian/3") || // @todo: report this (tested on Nokia N71) - t.version("Opera Mobi") >= 11 && t.is("SymbianOS")) { - return "B"; + if (t.os('iOS') && t.version('iPad') < 4.3 || t.os('iOS') && t.version('iPhone') < 3.1 || t.os('iOS') && t.version('iPod') < 3.1 || // Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770 + t.is('Blackberry') && t.version('BlackBerry') >= 5 && t.version('BlackBerry') < 6 || //Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3 + t.version('Opera Mini') >= 5.0 && t.version('Opera Mini') <= 6.5 && (t.version('Android') >= 2.3 || t.is('iOS')) || // Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1) + t.match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') || // @todo: report this (tested on Nokia N71) + t.version('Opera Mobi') >= 11 && t.is('SymbianOS')) { + return 'B'; } if (// Blackberry 4.x - Tested on the Curve 8330 - t.version("BlackBerry") < 5.0 || // Windows Mobile - Tested on the HTC Leo (WinMo 5.2) - t.match("MSIEMobile|Windows CE.*Mobile") || t.version("Windows Mobile") <= 5.2) { - return "C"; + t.version('BlackBerry') < 5.0 || // Windows Mobile - Tested on the HTC Leo (WinMo 5.2) + t.match('MSIEMobile|Windows CE.*Mobile') || t.version('Windows Mobile') <= 5.2) { + return 'C'; } //All older smartphone platforms and featurephones - Any device that doesn't support media queries //will receive the basic, C grade experience. - return "C"; + return 'C'; }; impl.detectOS = function(ua) { return impl.findMatch(impl.mobileDetectRules.oss0, ua) || impl.findMatch(impl.mobileDetectRules.oss, ua); @@ -571,7 +571,7 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; * @constructor * @global */ function MobileDetect(userAgent, maxPhoneWidth) { - this.ua = userAgent || ""; + this.ua = userAgent || ''; this._cache = {}; //600dp is typical 7" tablet minimum width this.maxPhoneWidth = maxPhoneWidth || 600; @@ -799,7 +799,7 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; * @function MobileDetect#match */ match: function match(pattern) { if (!_instanceof(pattern, RegExp)) { - pattern = new RegExp(pattern, "i"); + pattern = new RegExp(pattern, 'i'); } return pattern.test(this.ua); }, @@ -828,7 +828,7 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; } }; // environment-dependent - if (typeof window !== "undefined" && window.screen) { + if (typeof window !== 'undefined' && window.screen) { MobileDetect.isPhoneSized = function(maxPhoneWidth) { return maxPhoneWidth < 0 ? undefined : impl.getDeviceSmallerSide() <= maxPhoneWidth; }; @@ -837,22 +837,22 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; } // should not be replaced by a completely new object - just overwrite existing methods MobileDetect._impl = impl; - MobileDetect.version = "1.3.3 2016-07-31"; + MobileDetect.version = '1.3.3 2016-07-31'; return MobileDetect; }); // end of call of define() })(function(undefined) { - if (typeof module !== "undefined" && module.exports) { + if (typeof module !== 'undefined' && module.exports) { return function(factory) { module.exports = factory(); }; - } else if (typeof define === "function" && define.amd) { + } else if (typeof define === 'function' && define.amd) { return define; - } else if (typeof window !== "undefined") { + } else if (typeof window !== 'undefined') { return function(factory) { window.MobileDetect = factory(); }; } else { // please file a bug if you get this error! - throw new Error("unknown environment"); + throw new Error('unknown environment'); } }()); diff --git a/crates/swc/tests/tsc-references/fixSignatureCaching.2.minified.js b/crates/swc/tests/tsc-references/fixSignatureCaching.2.minified.js index a0e240149494..d68c3e1ced27 100644 --- a/crates/swc/tests/tsc-references/fixSignatureCaching.2.minified.js +++ b/crates/swc/tests/tsc-references/fixSignatureCaching.2.minified.js @@ -2,14 +2,14 @@ var undefined; import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; (function(undefined) { - if ("undefined" != typeof module && module.exports) return function(factory) { + if ('undefined' != typeof module && module.exports) return function(factory) { module.exports = factory(); }; - if ("function" == typeof define && define.amd) return define; - if ("undefined" != typeof window) return function(factory) { + if ('function' == typeof define && define.amd) return define; + if ('undefined' != typeof window) return function(factory) { window.MobileDetect = factory(); }; - throw Error("unknown environment"); + throw Error('unknown environment'); })()(function() { var impl = {}; impl.mobileDetectRules = { @@ -166,18 +166,18 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; iOS: "\\biPhone.*Mobile|\\biPod|\\biPad", MeeGoOS: "MeeGo", MaemoOS: "Maemo", - JavaOS: "J2ME/|\\bMIDP\\b|\\bCLDC\\b", + JavaOS: "J2ME\/|\\bMIDP\\b|\\bCLDC\\b", webOS: "webOS|hpwOS", badaOS: "\\bBada\\b", BREWOS: "BREW" }, uas: { Vivaldi: "Vivaldi", - Chrome: "\\bCrMo\\b|CriOS|Android.*Chrome/[.0-9]* (Mobile)?", + Chrome: "\\bCrMo\\b|CriOS|Android.*Chrome\/[.0-9]* (Mobile)?", Dolfin: "\\bDolfin\\b", - Opera: "Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR/[0-9.]+|Coast/[0-9.]+", + Opera: "Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR\/[0-9.]+|Coast\/[0-9.]+", Skyfire: "Skyfire", - Edge: "Mobile Safari/[.0-9]* Edge", + Edge: "Mobile Safari\/[.0-9]* Edge", IE: "IEMobile|MSIEMobile", Firefox: "fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile", Bolt: "bolt", @@ -197,90 +197,90 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; PaleMoon: "Android.*PaleMoon|Mobile.*PaleMoon" }, props: { - Mobile: "Mobile/[VER]", - Build: "Build/[VER]", - Version: "Version/[VER]", - VendorID: "VendorID/[VER]", + Mobile: "Mobile\/[VER]", + Build: "Build\/[VER]", + Version: "Version\/[VER]", + VendorID: "VendorID\/[VER]", iPad: "iPad.*CPU[a-z ]+[VER]", iPhone: "iPhone.*CPU[a-z ]+[VER]", iPod: "iPod.*CPU[a-z ]+[VER]", - Kindle: "Kindle/[VER]", + Kindle: "Kindle\/[VER]", Chrome: [ - "Chrome/[VER]", - "CriOS/[VER]", - "CrMo/[VER]" + "Chrome\/[VER]", + "CriOS\/[VER]", + "CrMo\/[VER]" ], Coast: [ - "Coast/[VER]" + "Coast\/[VER]" ], - Dolfin: "Dolfin/[VER]", - Firefox: "Firefox/[VER]", - Fennec: "Fennec/[VER]", - Edge: "Edge/[VER]", + Dolfin: "Dolfin\/[VER]", + Firefox: "Firefox\/[VER]", + Fennec: "Fennec\/[VER]", + Edge: "Edge\/[VER]", IE: [ - "IEMobile/[VER];", + "IEMobile\/[VER];", "IEMobile [VER]", "MSIE [VER];", - "Trident/[0-9.]+;.*rv:[VER]" + "Trident\/[0-9.]+;.*rv:[VER]" ], - NetFront: "NetFront/[VER]", - NokiaBrowser: "NokiaBrowser/[VER]", + NetFront: "NetFront\/[VER]", + NokiaBrowser: "NokiaBrowser\/[VER]", Opera: [ - " OPR/[VER]", - "Opera Mini/[VER]", - "Version/[VER]" + " OPR\/[VER]", + "Opera Mini\/[VER]", + "Version\/[VER]" ], - "Opera Mini": "Opera Mini/[VER]", - "Opera Mobi": "Version/[VER]", + "Opera Mini": "Opera Mini\/[VER]", + "Opera Mobi": "Version\/[VER]", "UC Browser": "UC Browser[VER]", - MQQBrowser: "MQQBrowser/[VER]", - MicroMessenger: "MicroMessenger/[VER]", - baiduboxapp: "baiduboxapp/[VER]", - baidubrowser: "baidubrowser/[VER]", - Iron: "Iron/[VER]", + MQQBrowser: "MQQBrowser\/[VER]", + MicroMessenger: "MicroMessenger\/[VER]", + baiduboxapp: "baiduboxapp\/[VER]", + baidubrowser: "baidubrowser\/[VER]", + Iron: "Iron\/[VER]", Safari: [ - "Version/[VER]", - "Safari/[VER]" + "Version\/[VER]", + "Safari\/[VER]" ], - Skyfire: "Skyfire/[VER]", - Tizen: "Tizen/[VER]", - Webkit: "webkit[ /][VER]", - PaleMoon: "PaleMoon/[VER]", - Gecko: "Gecko/[VER]", - Trident: "Trident/[VER]", - Presto: "Presto/[VER]", - Goanna: "Goanna/[VER]", + Skyfire: "Skyfire\/[VER]", + Tizen: "Tizen\/[VER]", + Webkit: "webkit[ \/][VER]", + PaleMoon: "PaleMoon\/[VER]", + Gecko: "Gecko\/[VER]", + Trident: "Trident\/[VER]", + Presto: "Presto\/[VER]", + Goanna: "Goanna\/[VER]", iOS: " \\bi?OS\\b [VER][ ;]{1}", Android: "Android [VER]", BlackBerry: [ - "BlackBerry[\\w]+/[VER]", - "BlackBerry.*Version/[VER]", - "Version/[VER]" + "BlackBerry[\\w]+\/[VER]", + "BlackBerry.*Version\/[VER]", + "Version\/[VER]" ], BREW: "BREW [VER]", - Java: "Java/[VER]", + Java: "Java\/[VER]", "Windows Phone OS": [ "Windows Phone OS [VER]", "Windows Phone [VER]" ], "Windows Phone": "Windows Phone [VER]", - "Windows CE": "Windows CE/[VER]", + "Windows CE": "Windows CE\/[VER]", "Windows NT": "Windows NT [VER]", Symbian: [ - "SymbianOS/[VER]", - "Symbian/[VER]" + "SymbianOS\/[VER]", + "Symbian\/[VER]" ], webOS: [ - "webOS/[VER]", - "hpwOS/[VER];" + "webOS\/[VER]", + "hpwOS\/[VER];" ] }, utils: { Bot: "Googlebot|facebookexternalhit|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|Exabot|MJ12bot|YandexImages|TurnitinBot|Pingdom", - MobileBot: "Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker/M1A1-R2D2", + MobileBot: "Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker\/M1A1-R2D2", DesktopMode: "WPDesktop", TV: "SonyDTV|HbbTV", - WebKit: "(webkit)[ /]([\\w.]+)", + WebKit: "(webkit)[ \/]([\\w.]+)", Console: "\\b(Nintendo|Nintendo WiiU|Nintendo 3DS|PLAYSTATION|Xbox)\\b", Watch: "SM-V700" } @@ -300,21 +300,21 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; return !1; } function convertPropsToRegExp(object) { - for(var key in object)hasOwnProp.call(object, key) && (object[key] = RegExp(object[key], "i")); + for(var key in object)hasOwnProp.call(object, key) && (object[key] = RegExp(object[key], 'i')); } function MobileDetect(userAgent, maxPhoneWidth) { - this.ua = userAgent || "", this._cache = {}, this.maxPhoneWidth = maxPhoneWidth || 600; + this.ua = userAgent || '', this._cache = {}, this.maxPhoneWidth = maxPhoneWidth || 600; } - return impl.FALLBACK_PHONE = "UnknownPhone", impl.FALLBACK_TABLET = "UnknownTablet", impl.FALLBACK_MOBILE = "UnknownMobile", isArray = "isArray" in Array ? Array.isArray : function(value) { - return "[object Array]" === Object.prototype.toString.call(value); - }, isArray = "isArray" in Array ? function(value) { - return "[object Array]" === Object.prototype.toString.call(value); + return impl.FALLBACK_PHONE = 'UnknownPhone', impl.FALLBACK_TABLET = 'UnknownTablet', impl.FALLBACK_MOBILE = 'UnknownMobile', isArray = 'isArray' in Array ? Array.isArray : function(value) { + return '[object Array]' === Object.prototype.toString.call(value); + }, isArray = 'isArray' in Array ? function(value) { + return '[object Array]' === Object.prototype.toString.call(value); } : Array.isArray, !function() { var key, values, value, i, len, verPos, mobileDetectRules = impl.mobileDetectRules; for(key in mobileDetectRules.props)if (hasOwnProp.call(mobileDetectRules.props, key)) { for(values = mobileDetectRules.props[key], isArray(values) || (values = [ values - ]), len = values.length, i = 0; i < len; ++i)(verPos = (value = values[i]).indexOf("[VER]")) >= 0 && (value = value.substring(0, verPos) + "([\\w._\\+]+)" + value.substring(verPos + 5)), values[i] = RegExp(value, "i"); + ]), len = values.length, i = 0; i < len; ++i)(verPos = (value = values[i]).indexOf('[VER]')) >= 0 && (value = value.substring(0, verPos) + '([\\w._\\+]+)' + value.substring(verPos + 5)), values[i] = RegExp(value, 'i'); mobileDetectRules.props[key] = values; } convertPropsToRegExp(mobileDetectRules.oss), convertPropsToRegExp(mobileDetectRules.phones), convertPropsToRegExp(mobileDetectRules.tablets), convertPropsToRegExp(mobileDetectRules.uas), convertPropsToRegExp(mobileDetectRules.utils), mobileDetectRules.oss0 = { @@ -339,7 +339,7 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; return version ? impl.prepareVersionNo(version) : NaN; }, impl.prepareVersionNo = function(version) { var numbers; - return 1 === (numbers = version.split(/[a-z._ \/\-]/i)).length && (version = numbers[0]), numbers.length > 1 && (version = numbers[0] + ".", numbers.shift(), version += numbers.join("")), Number(version); + return 1 === (numbers = version.split(/[a-z._ \/\-]/i)).length && (version = numbers[0]), numbers.length > 1 && (version = numbers[0] + '.', numbers.shift(), version += numbers.join('')), Number(version); }, impl.isMobileFallback = function(userAgent) { return impl.detectMobileBrowsers.fullPattern.test(userAgent) || impl.detectMobileBrowsers.shortPattern.test(userAgent.substr(0, 4)); }, impl.isTabletFallback = function(userAgent) { @@ -359,7 +359,7 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; } }, impl.mobileGrade = function(t) { var $isMobile = null !== t.mobile(); - return t.os("iOS") && t.version("iPad") >= 4.3 || t.os("iOS") && t.version("iPhone") >= 3.1 || t.os("iOS") && t.version("iPod") >= 3.1 || t.version("Android") > 2.1 && t.is("Webkit") || t.version("Windows Phone OS") >= 7.0 || t.is("BlackBerry") && t.version("BlackBerry") >= 6.0 || t.match("Playbook.*Tablet") || t.version("webOS") >= 1.4 && t.match("Palm|Pre|Pixi") || t.match("hp.*TouchPad") || t.is("Firefox") && t.version("Firefox") >= 12 || t.is("Chrome") && t.is("AndroidOS") && t.version("Android") >= 4.0 || t.is("Skyfire") && t.version("Skyfire") >= 4.1 && t.is("AndroidOS") && t.version("Android") >= 2.3 || t.is("Opera") && t.version("Opera Mobi") > 11 && t.is("AndroidOS") || t.is("MeeGoOS") || t.is("Tizen") || t.is("Dolfin") && t.version("Bada") >= 2.0 || (t.is("UC Browser") || t.is("Dolfin")) && t.version("Android") >= 2.3 || t.match("Kindle Fire") || t.is("Kindle") && t.version("Kindle") >= 3.0 || t.is("AndroidOS") && t.is("NookTablet") || t.version("Chrome") >= 11 && !$isMobile || t.version("Safari") >= 5.0 && !$isMobile || t.version("Firefox") >= 4.0 && !$isMobile || t.version("MSIE") >= 7.0 && !$isMobile || t.version("Opera") >= 10 && !$isMobile ? "A" : t.os("iOS") && 4.3 > t.version("iPad") || t.os("iOS") && 3.1 > t.version("iPhone") || t.os("iOS") && 3.1 > t.version("iPod") || t.is("Blackberry") && t.version("BlackBerry") >= 5 && 6 > t.version("BlackBerry") || t.version("Opera Mini") >= 5.0 && 6.5 >= t.version("Opera Mini") && (t.version("Android") >= 2.3 || t.is("iOS")) || t.match("NokiaN8|NokiaC7|N97.*Series60|Symbian/3") || t.version("Opera Mobi") >= 11 && t.is("SymbianOS") ? "B" : (5.0 > t.version("BlackBerry") || t.match("MSIEMobile|Windows CE.*Mobile") || t.version("Windows Mobile"), "C"); + return t.os('iOS') && t.version('iPad') >= 4.3 || t.os('iOS') && t.version('iPhone') >= 3.1 || t.os('iOS') && t.version('iPod') >= 3.1 || t.version('Android') > 2.1 && t.is('Webkit') || t.version('Windows Phone OS') >= 7.0 || t.is('BlackBerry') && t.version('BlackBerry') >= 6.0 || t.match('Playbook.*Tablet') || t.version('webOS') >= 1.4 && t.match('Palm|Pre|Pixi') || t.match('hp.*TouchPad') || t.is('Firefox') && t.version('Firefox') >= 12 || t.is('Chrome') && t.is('AndroidOS') && t.version('Android') >= 4.0 || t.is('Skyfire') && t.version('Skyfire') >= 4.1 && t.is('AndroidOS') && t.version('Android') >= 2.3 || t.is('Opera') && t.version('Opera Mobi') > 11 && t.is('AndroidOS') || t.is('MeeGoOS') || t.is('Tizen') || t.is('Dolfin') && t.version('Bada') >= 2.0 || (t.is('UC Browser') || t.is('Dolfin')) && t.version('Android') >= 2.3 || t.match('Kindle Fire') || t.is('Kindle') && t.version('Kindle') >= 3.0 || t.is('AndroidOS') && t.is('NookTablet') || t.version('Chrome') >= 11 && !$isMobile || t.version('Safari') >= 5.0 && !$isMobile || t.version('Firefox') >= 4.0 && !$isMobile || t.version('MSIE') >= 7.0 && !$isMobile || t.version('Opera') >= 10 && !$isMobile ? 'A' : t.os('iOS') && 4.3 > t.version('iPad') || t.os('iOS') && 3.1 > t.version('iPhone') || t.os('iOS') && 3.1 > t.version('iPod') || t.is('Blackberry') && t.version('BlackBerry') >= 5 && 6 > t.version('BlackBerry') || t.version('Opera Mini') >= 5.0 && 6.5 >= t.version('Opera Mini') && (t.version('Android') >= 2.3 || t.is('iOS')) || t.match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') || t.version('Opera Mobi') >= 11 && t.is('SymbianOS') ? 'B' : (5.0 > t.version('BlackBerry') || t.match('MSIEMobile|Windows CE.*Mobile') || t.version('Windows Mobile'), 'C'); }, impl.detectOS = function(ua) { return impl.findMatch(impl.mobileDetectRules.oss0, ua) || impl.findMatch(impl.mobileDetectRules.oss, ua); }, impl.getDeviceSmallerSide = function() { @@ -394,7 +394,7 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; return containsIC(this.userAgents(), key) || equalIC(key, this.os()) || equalIC(key, this.phone()) || equalIC(key, this.tablet()) || containsIC(impl.findMatches(impl.mobileDetectRules.utils, this.ua), key); }, match: function(pattern) { - return _instanceof(pattern, RegExp) || (pattern = RegExp(pattern, "i")), pattern.test(this.ua); + return _instanceof(pattern, RegExp) || (pattern = RegExp(pattern, 'i')), pattern.test(this.ua); }, isPhoneSized: function(maxPhoneWidth) { return MobileDetect.isPhoneSized(maxPhoneWidth || this.maxPhoneWidth); @@ -402,7 +402,7 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; mobileGrade: function() { return undefined === this._cache.grade && (this._cache.grade = impl.mobileGrade(this)), this._cache.grade; } - }, "undefined" != typeof window && window.screen ? MobileDetect.isPhoneSized = function(maxPhoneWidth) { + }, 'undefined' != typeof window && window.screen ? MobileDetect.isPhoneSized = function(maxPhoneWidth) { return maxPhoneWidth < 0 ? undefined : impl.getDeviceSmallerSide() <= maxPhoneWidth; - } : MobileDetect.isPhoneSized = function() {}, MobileDetect._impl = impl, MobileDetect.version = "1.3.3 2016-07-31", MobileDetect; + } : MobileDetect.isPhoneSized = function() {}, MobileDetect._impl = impl, MobileDetect.version = '1.3.3 2016-07-31', MobileDetect; }); diff --git a/crates/swc/tests/tsc-references/for-inStatements.1.normal.js b/crates/swc/tests/tsc-references/for-inStatements.1.normal.js index bb5750b6750b..c7617817dc56 100644 --- a/crates/swc/tests/tsc-references/for-inStatements.1.normal.js +++ b/crates/swc/tests/tsc-references/for-inStatements.1.normal.js @@ -25,7 +25,7 @@ var c, d, e; for(var x in c || d){} for(var x in e ? c : d){} for(var x in 42 ? c : d){} -for(var x in "" ? c : d){} +for(var x in '' ? c : d){} for(var x in 42 ? d[x] : c[x]){} for(var x in c[d]){} for(var x in function(x) { diff --git a/crates/swc/tests/tsc-references/forStatements.1.normal.js b/crates/swc/tests/tsc-references/forStatements.1.normal.js index 6788d49bc521..60a6f0e53271 100644 --- a/crates/swc/tests/tsc-references/forStatements.1.normal.js +++ b/crates/swc/tests/tsc-references/forStatements.1.normal.js @@ -24,7 +24,7 @@ var M; M.F2 = F2; })(M || (M = {})); for(var aNumber = 9.9;;){} -for(var aString = "this is a string";;){} +for(var aString = 'this is a string';;){} for(var aDate = new Date(12);;){} for(var anObject = new Object();;){} for(var anAny = null;;){} @@ -45,5 +45,5 @@ for(var aLambda = function(x) { for(var aModule = M;;){} for(var aClassInModule = new M.A();;){} for(var aFunctionInModule = function(x) { - return "this is a string"; + return 'this is a string'; };;){} diff --git a/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl.1.normal.js b/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl.1.normal.js index 32aa0f8c48f1..2b658830d73d 100644 --- a/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl.1.normal.js +++ b/crates/swc/tests/tsc-references/forStatementsMultipleInvalidDecl.1.normal.js @@ -38,7 +38,7 @@ var M; // all of these are errors for(var a;;){} for(var a = 1;;){} -for(var a = "a string";;){} +for(var a = 'a string';;){} for(var a = new C();;){} for(var a = new D();;){} for(var a = M;;){} @@ -47,7 +47,7 @@ for(var b = new C();;){} for(var b = new C2();;){} for(var f = F;;){} for(var f = function(x) { - return ""; + return ''; };;){} for(var arr;;){} for(var arr = [ diff --git a/crates/swc/tests/tsc-references/forStatementsMultipleValidDecl.1.normal.js b/crates/swc/tests/tsc-references/forStatementsMultipleValidDecl.1.normal.js index e2120e18813c..69538fa552b7 100644 --- a/crates/swc/tests/tsc-references/forStatementsMultipleValidDecl.1.normal.js +++ b/crates/swc/tests/tsc-references/forStatementsMultipleValidDecl.1.normal.js @@ -5,7 +5,7 @@ for(var x = 2;;){} for(var x = undefined;;){} // new declaration space, making redeclaring x as a string valid function declSpace() { - for(var x = "this is a string";;){} + for(var x = 'this is a string';;){} } for(var p;;){} for(var p = { @@ -41,8 +41,8 @@ for(var fn = null;;){} for(var fn;;){} for(var a;;){} for(var a = [ - "a", - "b" + 'a', + 'b' ];;){} for(var a = [];;){} for(var a = [];;){} diff --git a/crates/swc/tests/tsc-references/functionCalls.1.normal.js b/crates/swc/tests/tsc-references/functionCalls.1.normal.js index 5c2039d61336..8beb6b61d3fc 100644 --- a/crates/swc/tests/tsc-references/functionCalls.1.normal.js +++ b/crates/swc/tests/tsc-references/functionCalls.1.normal.js @@ -2,24 +2,24 @@ // Invoke function call on value of type 'any' with no type arguments var anyVar; anyVar(0); -anyVar(""); +anyVar(''); // Invoke function call on value of type 'any' with type arguments // These should be errors -anyVar("hello"); +anyVar('hello'); anyVar(); anyVar(undefined); var subFunc; subFunc(0); -subFunc(""); +subFunc(''); subFunc(); // Invoke function call on value of a subtype of Function with no call signatures with type arguments // These should be errors subFunc(0); -subFunc(""); +subFunc(''); subFunc(); // Invoke function call on value of type Function with no call signatures with type arguments // These should be errors var func; func(0); -func(""); +func(''); func(); diff --git a/crates/swc/tests/tsc-references/functionCalls.2.minified.js b/crates/swc/tests/tsc-references/functionCalls.2.minified.js index 9b386eb819b4..0c3304d33f61 100644 --- a/crates/swc/tests/tsc-references/functionCalls.2.minified.js +++ b/crates/swc/tests/tsc-references/functionCalls.2.minified.js @@ -1,3 +1,3 @@ //// [functionCalls.ts] var anyVar, subFunc, func; -anyVar(0), anyVar(""), anyVar("hello"), anyVar(), anyVar(void 0), subFunc(0), subFunc(""), subFunc(), subFunc(0), subFunc(""), subFunc(), func(0), func(""), func(); +anyVar(0), anyVar(''), anyVar('hello'), anyVar(), anyVar(void 0), subFunc(0), subFunc(''), subFunc(), subFunc(0), subFunc(''), subFunc(), func(0), func(''), func(); diff --git a/crates/swc/tests/tsc-references/functionImplementationErrors.1.normal.js b/crates/swc/tests/tsc-references/functionImplementationErrors.1.normal.js index a8bc3488628f..28311a67de3d 100644 --- a/crates/swc/tests/tsc-references/functionImplementationErrors.1.normal.js +++ b/crates/swc/tests/tsc-references/functionImplementationErrors.1.normal.js @@ -4,22 +4,22 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; var f1 = function f1() { - return ""; + return ''; return 3; }; var f2 = function x() { - return ""; + return ''; return 3; }; var f3 = function() { - return ""; + return ''; return 3; }; // FunctionExpression with no return type annotation with return branch of number[] and other of string[] var f4 = function f4() { if (true) { return [ - "" + '' ]; } else { return [ diff --git a/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements.1.normal.js b/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements.1.normal.js index f3b040c2f2a9..0ded026e2bb4 100644 --- a/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements.1.normal.js +++ b/crates/swc/tests/tsc-references/functionWithMultipleReturnStatements.1.normal.js @@ -5,7 +5,7 @@ function f1() { if (true) { return 1; } else { - return ""; + return ''; } } function f2() { @@ -14,26 +14,26 @@ function f2() { } else if (false) { return 2; } else { - return ""; + return ''; } } function f3() { try { return 1; } catch (e) { - return ""; + return ''; } } function f4() { try { return 1; } catch (e) {} finally{ - return ""; + return ''; } } function f5() { return 1; - return ""; + return ''; } function f6(x, y) { if (true) { diff --git a/crates/swc/tests/tsc-references/genericCallTypeArgumentInference.1.normal.js b/crates/swc/tests/tsc-references/genericCallTypeArgumentInference.1.normal.js index 5fa405b324ad..c9659372163e 100644 --- a/crates/swc/tests/tsc-references/genericCallTypeArgumentInference.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallTypeArgumentInference.1.normal.js @@ -4,7 +4,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; function foo(t) { return t; } -var r = foo(""); // string +var r = foo(''); // string function foo2(t, u) { return u; } @@ -12,7 +12,7 @@ function foo2b(u) { var x; return x; } -var r2 = foo2("", 1); // number +var r2 = foo2('', 1); // number var r3 = foo2b(1); // {} var C = /*#__PURE__*/ function() { "use strict"; @@ -51,21 +51,21 @@ var C = /*#__PURE__*/ function() { }; return C; }(); -var c = new C("", 1); -var r4 = c.foo("", 1); // string -var r5 = c.foo2("", 1); // number +var c = new C('', 1); +var r4 = c.foo('', 1); // string +var r5 = c.foo2('', 1); // number var r6 = c.foo3(true, 1); // boolean -var r7 = c.foo4("", true); // string +var r7 = c.foo4('', true); // string var r8 = c.foo5(true, 1); // boolean var r9 = c.foo6(); // {} -var r10 = c.foo7(""); // {} +var r10 = c.foo7(''); // {} var r11 = c.foo8(); // {} var i; -var r4 = i.foo("", 1); // string -var r5 = i.foo2("", 1); // number +var r4 = i.foo('', 1); // string +var r5 = i.foo2('', 1); // number var r6 = i.foo3(true, 1); // boolean -var r7 = i.foo4("", true); // string +var r7 = i.foo4('', true); // string var r8 = i.foo5(true, 1); // boolean var r9 = i.foo6(); // {} -var r10 = i.foo7(""); // {} +var r10 = i.foo7(''); // {} var r11 = i.foo8(); // {} diff --git a/crates/swc/tests/tsc-references/genericCallTypeArgumentInference.2.minified.js b/crates/swc/tests/tsc-references/genericCallTypeArgumentInference.2.minified.js index d799db813152..47063b0d12b9 100644 --- a/crates/swc/tests/tsc-references/genericCallTypeArgumentInference.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallTypeArgumentInference.2.minified.js @@ -16,5 +16,5 @@ var i, c = new (function() { }, _proto.foo5 = function(t, u) { return t; }, _proto.foo6 = function() {}, _proto.foo7 = function(u) {}, _proto.foo8 = function() {}, C; -}())("", 1); -c.foo("", 1), c.foo2("", 1), c.foo3(!0, 1), c.foo4("", !0), c.foo5(!0, 1), c.foo6(), c.foo7(""), c.foo8(), i.foo("", 1), i.foo2("", 1), i.foo3(!0, 1), i.foo4("", !0), i.foo5(!0, 1), i.foo6(), i.foo7(""), i.foo8(); +}())('', 1); +c.foo('', 1), c.foo2('', 1), c.foo3(!0, 1), c.foo4('', !0), c.foo5(!0, 1), c.foo6(), c.foo7(''), c.foo8(), i.foo('', 1), i.foo2('', 1), i.foo3(!0, 1), i.foo4('', !0), i.foo5(!0, 1), i.foo6(), i.foo7(''), i.foo8(); diff --git a/crates/swc/tests/tsc-references/genericCallWithArrayLiteralArgs.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithArrayLiteralArgs.1.normal.js index 6a0bf554da43..24088e59da38 100644 --- a/crates/swc/tests/tsc-references/genericCallWithArrayLiteralArgs.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithArrayLiteralArgs.1.normal.js @@ -18,13 +18,13 @@ var r2 = foo([]); // any[] var r3 = foo([]); // number[] var r4 = foo([ 1, - "" + '' ]); // {}[] var r5 = foo([ 1, - "" + '' ]); // any[] var r6 = foo([ 1, - "" + '' ]); // Object[] diff --git a/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments.1.normal.js index 1d90ca356fc8..beb2db904509 100644 --- a/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments.1.normal.js @@ -5,52 +5,52 @@ function foo(x) { return x(null); } var r = foo(function(x) { - return ""; + return ''; }); // {} var r2 = foo(function(x) { - return ""; + return ''; }); // string var r3 = foo(function(x) { - return ""; + return ''; }); // {} function foo2(x, cb) { return cb(x); } var r4 = foo2(1, function(a) { - return ""; + return ''; }); // string, contextual signature instantiation is applied to generic functions var r5 = foo2(1, function(a) { - return ""; + return ''; }); // string -var r6 = foo2("", function(a) { +var r6 = foo2('', function(a) { return 1; }); function foo3(x, cb, y) { return cb(x); } var r7 = foo3(1, function(a) { - return ""; -}, ""); // string + return ''; +}, ''); // string var r8 = foo3(1, function(a) { - return ""; + return ''; }, 1); // error var r9 = foo3(1, function(a) { - return ""; -}, ""); // string + return ''; +}, ''); // string function other(t, u) { var r10 = foo2(1, function(x) { - return ""; + return ''; }); // error var r10 = foo2(1, function(x) { - return ""; + return ''; }); // string var r11 = foo3(1, function(x) { - return ""; - }, ""); // error + return ''; + }, ''); // error var r11b = foo3(1, function(x) { - return ""; + return ''; }, 1); // error var r12 = foo3(1, function(a) { - return ""; + return ''; }, 1); // error } diff --git a/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments2.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments2.1.normal.js index 94a2a033aed0..c7281a8d1f82 100644 --- a/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments2.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments2.1.normal.js @@ -17,11 +17,11 @@ function foo2(x, cb) { var r4 = foo2(1, i2); // error var r4b = foo2(1, a); // any var r5 = foo2(1, i); // any -var r6 = foo2("", i2); // string +var r6 = foo2('', i2); // string function foo3(x, cb, y) { return new cb(x); } -var r7 = foo3(null, i, ""); // any -var r7b = foo3(null, a, ""); // any +var r7 = foo3(null, i, ''); // any +var r7b = foo3(null, a, ''); // any var r8 = foo3(1, i2, 1); // error -var r9 = foo3("", i2, ""); // string +var r9 = foo3('', i2, ''); // string diff --git a/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments2.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments2.2.minified.js index 9b36565462c6..d0ba3a318d2c 100644 --- a/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments2.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments2.2.minified.js @@ -3,4 +3,4 @@ var i, i2, a; function foo(x) { return new x(null); } -foo(i), foo(i), foo(i2), foo(a), new i2(1), new a(1), new i(1), new i2(""), new i(null), new a(null), new i2(1), new i2(""); +foo(i), foo(i), foo(i2), foo(a), new i2(1), new a(1), new i(1), new i2(''), new i(null), new a(null), new i2(1), new i2(''); diff --git a/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments5.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments5.1.normal.js index 4dfb3c64e419..66191f0afd42 100644 --- a/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments5.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments5.1.normal.js @@ -5,19 +5,19 @@ function foo(arg) { } var arg = { cb: function(x) { - return ""; + return ''; } }; var r = foo(arg); // {} // more args not allowed var r2 = foo({ cb: function(x, y) { - return ""; + return ''; } }); // error var r3 = foo({ cb: function(x, y) { - return ""; + return ''; } }); // error function foo2(arg) { @@ -27,16 +27,16 @@ function foo2(arg) { var r4 = foo(arg); // {} var r5 = foo({ cb: function(x) { - return ""; + return ''; } }); // {} var r6 = foo({ cb: function(x) { - return ""; + return ''; } }); // string var r7 = foo({ cb: function() { - return ""; + return ''; } }); // string diff --git a/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments5.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments5.2.minified.js index eae3a10c9de9..c01c478c7d56 100644 --- a/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments5.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithFunctionTypedArguments5.2.minified.js @@ -4,27 +4,27 @@ function foo(arg) { } var arg = { cb: function(x) { - return ""; + return ''; } }; foo(arg), foo({ cb: function(x, y) { - return ""; + return ''; } }), foo({ cb: function(x, y) { - return ""; + return ''; } }), foo(arg), foo({ cb: function(x) { - return ""; + return ''; } }), foo({ cb: function(x) { - return ""; + return ''; } }), foo({ cb: function() { - return ""; + return ''; } }); diff --git a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments.1.normal.js index c8e825bb631d..af2b5acc2964 100644 --- a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments.1.normal.js @@ -9,12 +9,12 @@ function foo(a, b) { var r1b = foo(function(x) { return 1; }, function(x) { - return ""; + return ''; }); // {} => {} var r2 = foo(function(x) { return null; }, function(x) { - return ""; + return ''; }); // Object => Object var r3 = foo(function(x) { return 1; diff --git a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2.1.normal.js index 2c572e285a15..f2966cc587ee 100644 --- a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments2.1.normal.js @@ -10,7 +10,7 @@ var onlyT; var r1 = foo(function(x) { return 1; }, function(x) { - return ""; + return ''; }); function other2(x) { var r7 = foo(function(a) { @@ -65,7 +65,7 @@ var TU; var r1 = foo(function(x) { return 1; }, function(x) { - return ""; + return ''; }); function other2(x) { var r7 = foo(function(a) { diff --git a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3.1.normal.js index 5ebad0d55807..eaee357e982f 100644 --- a/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithGenericSignatureArguments3.1.normal.js @@ -5,35 +5,35 @@ function foo(x, a, b) { var r; return r; } -var r1 = foo("", function(x) { - return ""; +var r1 = foo('', function(x) { + return ''; }, function(x) { return null; }); // any => any -var r1ii = foo("", function(x) { - return ""; +var r1ii = foo('', function(x) { + return ''; }, function(x) { return null; }); // string => string -var r2 = foo("", function(x) { - return ""; +var r2 = foo('', function(x) { + return ''; }, function(x) { - return ""; + return ''; }); // string => string var r3 = foo(null, function(x) { - return ""; + return ''; }, function(x) { - return ""; + return ''; }); // Object => Object var r4 = foo(null, function(x) { - return ""; + return ''; }, function(x) { - return ""; + return ''; }); // any => any var r5 = foo(new Object(), function(x) { - return ""; + return ''; }, function(x) { - return ""; + return ''; }); // Object => Object var E; (function(E) { @@ -52,20 +52,20 @@ function foo2(x, a, b) { var r; return r; } -var r8 = foo2("", function(x) { - return ""; +var r8 = foo2('', function(x) { + return ''; }, function(x) { return null; }); // string => string var r9 = foo2(null, function(x) { - return ""; + return ''; }, function(x) { - return ""; + return ''; }); // any => any var r10 = foo2(null, function(x) { - return ""; + return ''; }, function(x) { - return ""; + return ''; }); // Object => Object var x; var r11 = foo2(x, function(a1) { diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectLiteralArgs.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithObjectLiteralArgs.1.normal.js index 455ba9e67448..a0eaac5ad0df 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectLiteralArgs.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectLiteralArgs.1.normal.js @@ -4,7 +4,7 @@ function foo(x) { } var r = foo({ bar: 1, - baz: "" + baz: '' }); // error var r2 = foo({ bar: 1, @@ -16,5 +16,5 @@ var r3 = foo({ }); // T = typeof foo var r4 = foo({ bar: 1, - baz: "" + baz: '' }); // T = Object diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectLiteralArgs.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithObjectLiteralArgs.2.minified.js index ff50910e4217..9017b3681584 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectLiteralArgs.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectLiteralArgs.2.minified.js @@ -4,7 +4,7 @@ function foo(x) { } foo({ bar: 1, - baz: "" + baz: '' }), foo({ bar: 1, baz: 1 @@ -13,5 +13,5 @@ foo({ baz: foo }), foo({ bar: 1, - baz: "" + baz: '' }); diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4.1.normal.js index 35a8fdb3f154..5697aa14bf13 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4.1.normal.js @@ -19,7 +19,7 @@ var d; var r = foo(c, d); var r2 = foo(d, c); // error because C does not extend D var r3 = foo(c, { - x: "", + x: '', foo: c }); var r4 = foo(null, null); diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4.2.minified.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4.2.minified.js index 0bfad1e7f75a..f2003428d9ae 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4.2.minified.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndConstraints4.2.minified.js @@ -7,7 +7,7 @@ function foo(t, t2) { }; } foo(c, d), foo(d, c), foo(c, { - x: "", + x: '', foo: c }), foo(null, null), foo({}, null), foo(null, {}), foo({}, {}), foo(function() {}, function() {}), foo(function() {}, function() { return 1; diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndIndexers.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndIndexers.1.normal.js index dacc0603b337..5f9fc4962eb3 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndIndexers.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndIndexers.1.normal.js @@ -9,5 +9,5 @@ function other(arg) { var b; var r2 = foo(b); var d = r2[1]; - var e = r2["1"]; + var e = r2['1']; } diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndIndexersErrors.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndIndexersErrors.1.normal.js index 5a38101a6f0b..e7eecde95c86 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndIndexersErrors.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndIndexersErrors.1.normal.js @@ -11,6 +11,6 @@ function other3(arg) { var b; var r2 = foo(b); var d = r2[1]; - var e = r2["1"]; + var e = r2['1']; var u = r2[1]; // ok } diff --git a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndStringIndexer.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndStringIndexer.1.normal.js index 53507a2cb0f3..09ff97019422 100644 --- a/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndStringIndexer.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithObjectTypeArgsAndStringIndexer.1.normal.js @@ -12,12 +12,12 @@ function other(arg) { function other2(arg) { var b; var r2 = foo(b); - var d = r2["hm"]; // ok + var d = r2['hm']; // ok } function other3(arg) { var b; var r2 = foo(b); - var d = r2["hm"]; // ok + var d = r2['hm']; // ok // BUG 821629 //var u: U = r2['hm']; // ok } //function other3(arg: T) { diff --git a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments.1.normal.js index 91f6c46224bc..cdb2d190bdd7 100644 --- a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments.1.normal.js @@ -32,10 +32,10 @@ var GenericParameter; return x; }); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]. T is any var r9 = foo6(function(x) { - return ""; + return ''; }); // any => string (+1 overload) var r11 = foo6(function(x, y) { - return ""; + return ''; }); // any => string (+1 overload) function foo7(x, cb) { return cb; @@ -44,7 +44,7 @@ var GenericParameter; return x; }); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] var r13 = foo7(1, function(x) { - return ""; + return ''; }); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] var a; var r14 = foo7(1, a); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] diff --git a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2.1.normal.js b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2.1.normal.js index 546b8cdf9972..fa5308a99ada 100644 --- a/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2.1.normal.js +++ b/crates/swc/tests/tsc-references/genericCallWithOverloadedFunctionTypedArguments2.1.normal.js @@ -24,7 +24,7 @@ var GenericParameter; return cb; } var r10 = foo6(function(x, y) { - return ""; + return ''; }); // error function foo7(x, cb) { return cb; diff --git a/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments.1.normal.js b/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments.1.normal.js index 0f9cd0d8e064..2d5e8591aa31 100644 --- a/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments.1.normal.js +++ b/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments.1.normal.js @@ -17,13 +17,13 @@ var ImmediatelyFix; }(); var c = new C(); var r = c.foo(function(x) { - return ""; + return ''; }); // {} var r2 = c.foo(function(x) { - return ""; + return ''; }); // string var r3 = c.foo(function(x) { - return ""; + return ''; }); // {} var C2 = /*#__PURE__*/ function() { "use strict"; @@ -59,12 +59,12 @@ var WithCandidates; }(); var c; var r4 = c.foo2(1, function(a) { - return ""; + return ''; }); // string, contextual signature instantiation is applied to generic functions var r5 = c.foo2(1, function(a) { - return ""; + return ''; }); // string - var r6 = c.foo2("", function(a) { + var r6 = c.foo2('', function(a) { return 1; }); // number var C2 = /*#__PURE__*/ function() { @@ -80,11 +80,11 @@ var WithCandidates; }(); var c2; var r7 = c2.foo3(1, function(a) { - return ""; - }, ""); // string + return ''; + }, ''); // string var r8 = c2.foo3(1, function(a) { - return ""; - }, ""); // string + return ''; + }, ''); // string var C3 = /*#__PURE__*/ function() { "use strict"; function C3() { @@ -99,19 +99,19 @@ var WithCandidates; var c3; function other(t, u) { var r10 = c.foo2(1, function(x) { - return ""; + return ''; }); // error var r10 = c.foo2(1, function(x) { - return ""; + return ''; }); // string var r11 = c3.foo3(1, function(x) { - return ""; - }, ""); // error + return ''; + }, ''); // error var r11b = c3.foo3(1, function(x) { - return ""; + return ''; }, 1); // error var r12 = c3.foo3(1, function(a) { - return ""; + return ''; }, 1); // error } })(WithCandidates || (WithCandidates = {})); diff --git a/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments.2.minified.js b/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments.2.minified.js index 9e7770394496..2e6b78a5868a 100644 --- a/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments.2.minified.js +++ b/crates/swc/tests/tsc-references/genericClassWithFunctionTypedMemberArguments.2.minified.js @@ -9,11 +9,11 @@ ImmediatelyFix || (ImmediatelyFix = {}), (c = new (function() { return x(null); }, C; }())()).foo(function(x) { - return ""; + return ''; }), c.foo(function(x) { - return ""; + return ''; }), c.foo(function(x) { - return ""; + return ''; }), (c2 = new (function() { function C2() { _class_call_check(this, C2); @@ -26,13 +26,13 @@ ImmediatelyFix || (ImmediatelyFix = {}), (c = new (function() { }), c2.foo(function(x) { return 1; }), WithCandidates || (WithCandidates = {}), c1.foo2(1, function(a) { - return ""; + return ''; }), c1.foo2(1, function(a) { - return ""; -}), c1.foo2("", function(a) { + return ''; +}), c1.foo2('', function(a) { return 1; }), c21.foo3(1, function(a) { - return ""; -}, ""), c21.foo3(1, function(a) { - return ""; -}, ""); + return ''; +}, ''), c21.foo3(1, function(a) { + return ''; +}, ''); diff --git a/crates/swc/tests/tsc-references/genericRestParameters1.1.normal.js b/crates/swc/tests/tsc-references/genericRestParameters1.1.normal.js index 7e6967f15c02..866e7143516a 100644 --- a/crates/swc/tests/tsc-references/genericRestParameters1.1.normal.js +++ b/crates/swc/tests/tsc-references/genericRestParameters1.1.normal.js @@ -153,10 +153,10 @@ var c30 = f30(42, function(x) { }, function(x) { return x + 1; }); // [(x: number) => string, (x: number) => number] -events.emit("move", 10, "left"); -events.emit("jump", 20, "up"); -events.emit("stop", "Bye!"); -events.emit("done"); +events.emit('move', 10, 'left'); +events.emit('jump', 20, 'up'); +events.emit('stop', 'Bye!'); +events.emit('done'); ff1 = ff2; ff1 = ff3; ff1 = ff4; // Error diff --git a/crates/swc/tests/tsc-references/genericRestParameters1.2.minified.js b/crates/swc/tests/tsc-references/genericRestParameters1.2.minified.js index 63efb035e85d..03402b617850 100644 --- a/crates/swc/tests/tsc-references/genericRestParameters1.2.minified.js +++ b/crates/swc/tests/tsc-references/genericRestParameters1.2.minified.js @@ -73,4 +73,4 @@ g20(42, "hello", !0), g20(42, "hello"), g20(42), g21("hello", !0), g21("hello"), return "" + x; }, function(x) { return x + 1; -}), events.emit("move", 10, "left"), events.emit("jump", 20, "up"), events.emit("stop", "Bye!"), events.emit("done"), ff1 = ff2, ff1 = ff3, ff1 = ff4; +}), events.emit('move', 10, 'left'), events.emit('jump', 20, 'up'), events.emit('stop', 'Bye!'), events.emit('done'), ff1 = ff2, ff1 = ff3, ff1 = ff4; diff --git a/crates/swc/tests/tsc-references/globalMergeWithCommonJSAssignmentDeclaration.1.normal.js b/crates/swc/tests/tsc-references/globalMergeWithCommonJSAssignmentDeclaration.1.normal.js index ab47356bea26..69abdde3744f 100644 --- a/crates/swc/tests/tsc-references/globalMergeWithCommonJSAssignmentDeclaration.1.normal.js +++ b/crates/swc/tests/tsc-references/globalMergeWithCommonJSAssignmentDeclaration.1.normal.js @@ -1,4 +1,4 @@ //// [bug27099.js] window.name = 1; window.console; // should not have error: Property 'console' does not exist on type 'typeof window'. -module.exports = "anything"; +module.exports = 'anything'; diff --git a/crates/swc/tests/tsc-references/globalMergeWithCommonJSAssignmentDeclaration.2.minified.js b/crates/swc/tests/tsc-references/globalMergeWithCommonJSAssignmentDeclaration.2.minified.js index 05aad6d8b55b..6a48bfd31811 100644 --- a/crates/swc/tests/tsc-references/globalMergeWithCommonJSAssignmentDeclaration.2.minified.js +++ b/crates/swc/tests/tsc-references/globalMergeWithCommonJSAssignmentDeclaration.2.minified.js @@ -1,2 +1,2 @@ //// [bug27099.js] -window.name = 1, window.console, module.exports = "anything"; +window.name = 1, window.console, module.exports = 'anything'; diff --git a/crates/swc/tests/tsc-references/globalThisAmbientModules.1.normal.js b/crates/swc/tests/tsc-references/globalThisAmbientModules.1.normal.js index 825066bdd6de..7e5f5c7d53b1 100644 --- a/crates/swc/tests/tsc-references/globalThisAmbientModules.1.normal.js +++ b/crates/swc/tests/tsc-references/globalThisAmbientModules.1.normal.js @@ -3,4 +3,4 @@ var valueModule; (function(valueModule) { valueModule.val = 1; })(valueModule || (valueModule = {})); -var bad1 = "ambientModule"; +var bad1 = 'ambientModule'; diff --git a/crates/swc/tests/tsc-references/globalThisBlockscopedProperties.1.normal.js b/crates/swc/tests/tsc-references/globalThisBlockscopedProperties.1.normal.js index c05eac511435..d01f9885b43c 100644 --- a/crates/swc/tests/tsc-references/globalThisBlockscopedProperties.1.normal.js +++ b/crates/swc/tests/tsc-references/globalThisBlockscopedProperties.1.normal.js @@ -8,11 +8,11 @@ globalThis.y // should error, no property 'y' ; globalThis.z // should error, no property 'z' ; -globalThis["x"] // ok +globalThis['x'] // ok ; -globalThis["y"] // should error, no property 'y' +globalThis['y'] // should error, no property 'y' ; -globalThis["z"] // should error, no property 'z' +globalThis['z'] // should error, no property 'z' ; globalThis.Float64Array // ok ; diff --git a/crates/swc/tests/tsc-references/globalThisUnknown.1.normal.js b/crates/swc/tests/tsc-references/globalThisUnknown.1.normal.js index a333338d8a5b..0f50db253bbd 100644 --- a/crates/swc/tests/tsc-references/globalThisUnknown.1.normal.js +++ b/crates/swc/tests/tsc-references/globalThisUnknown.1.normal.js @@ -5,6 +5,6 @@ win.hi; this.hi; globalThis.hi; // element access is always ok without noImplicitAny -win["hi"]; -this["hi"]; -globalThis["hi"]; +win['hi']; +this['hi']; +globalThis['hi']; diff --git a/crates/swc/tests/tsc-references/globalThisUnknownNoImplicitAny.1.normal.js b/crates/swc/tests/tsc-references/globalThisUnknownNoImplicitAny.1.normal.js index 22333d4176c2..b80705e92696 100644 --- a/crates/swc/tests/tsc-references/globalThisUnknownNoImplicitAny.1.normal.js +++ b/crates/swc/tests/tsc-references/globalThisUnknownNoImplicitAny.1.normal.js @@ -3,6 +3,6 @@ win.hi; this.hi; globalThis.hi; -win["hi"]; -this["hi"]; -globalThis["hi"]; +win['hi']; +this['hi']; +globalThis['hi']; diff --git a/crates/swc/tests/tsc-references/heterogeneousArrayLiterals.1.normal.js b/crates/swc/tests/tsc-references/heterogeneousArrayLiterals.1.normal.js index ae32f9b8b6e5..0792c151cd67 100644 --- a/crates/swc/tests/tsc-references/heterogeneousArrayLiterals.1.normal.js +++ b/crates/swc/tests/tsc-references/heterogeneousArrayLiterals.1.normal.js @@ -5,7 +5,7 @@ import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; var a = [ 1, - "" + '' ]; // {}[] var b = [ 1, @@ -13,7 +13,7 @@ var b = [ ]; // number[] var c = [ 1, - "", + '', null ]; // {}[] var d = [ @@ -35,13 +35,13 @@ var g = [ 1 ], [ - "" + '' ] ]; // {}[] var h = [ { foo: 1, - bar: "" + bar: '' }, { foo: 2 @@ -50,10 +50,10 @@ var h = [ var i = [ { foo: 1, - bar: "" + bar: '' }, { - foo: "" + foo: '' } ]; // {}[] var j = [ @@ -61,7 +61,7 @@ var j = [ return 1; }, function() { - return ""; + return ''; } ]; // {}[] var k = [ @@ -85,7 +85,7 @@ var m = [ return 1; }, function() { - return ""; + return ''; }, function() { return null; @@ -99,7 +99,7 @@ var n = [ ], [ function() { - return ""; + return ''; } ] ]; // {}[] diff --git a/crates/swc/tests/tsc-references/ifDoWhileStatements.1.normal.js b/crates/swc/tests/tsc-references/ifDoWhileStatements.1.normal.js index c519837463c4..62e0faad62fb 100644 --- a/crates/swc/tests/tsc-references/ifDoWhileStatements.1.normal.js +++ b/crates/swc/tests/tsc-references/ifDoWhileStatements.1.normal.js @@ -63,12 +63,12 @@ do {}while (undefined); if (0.0) {} while(0.0){} do {}while (0.0); -if ("a string") {} -while("a string"){} -do {}while ("a string"); -if ("") {} -while(""){} -do {}while (""); +if ('a string') {} +while('a string'){} +do {}while ('a string'); +if ('') {} +while(''){} +do {}while (''); if (/[a-z]/) {} while(/[a-z]/){} do {}while (/[a-z]/); @@ -92,15 +92,15 @@ while({}){} do {}while ({}); if ({ x: 1, - y: "a" + y: 'a' }) {} while({ x: 1, - y: "a" + y: 'a' }){} do {}while ({ x: 1, - y: "a" + y: 'a' }); if (function() { return 43; @@ -134,11 +134,11 @@ var d = 0.0; if (d) {} while(d){} do {}while (d); -var e = "a string"; +var e = 'a string'; if (e) {} while(e){} do {}while (e); -var f = ""; +var f = ''; if (f) {} while(f){} do {}while (f); @@ -163,7 +163,7 @@ while(j){} do {}while (j); var k = { x: 1, - y: "a" + y: 'a' }; if (k) {} while(k){} diff --git a/crates/swc/tests/tsc-references/ifDoWhileStatements.2.minified.js b/crates/swc/tests/tsc-references/ifDoWhileStatements.2.minified.js index d0d27c3656a0..d504ad3ffa49 100644 --- a/crates/swc/tests/tsc-references/ifDoWhileStatements.2.minified.js +++ b/crates/swc/tests/tsc-references/ifDoWhileStatements.2.minified.js @@ -42,7 +42,7 @@ for(;;); for(var c = void 0; c;); do ; while (c); -for(var e = "a string"; e;); +for(var e = 'a string'; e;); do ; while (e); for(var g = /[a-z]/; g;); @@ -62,7 +62,7 @@ do ; while (j); for(var k = { x: 1, - y: "a" + y: 'a' }; k;); do ; while (k); diff --git a/crates/swc/tests/tsc-references/importAliasModuleExports.1.normal.js b/crates/swc/tests/tsc-references/importAliasModuleExports.1.normal.js index e3fe0ca31565..61fe3c7deaca 100644 --- a/crates/swc/tests/tsc-references/importAliasModuleExports.1.normal.js +++ b/crates/swc/tests/tsc-references/importAliasModuleExports.1.normal.js @@ -13,7 +13,7 @@ var Alias = /*#__PURE__*/ function() { }(); module.exports = Alias; //// [main.js] -import A from "./mod1"; +import A from './mod1'; A.prototype.foo = 0; A.prototype.func = function() { this._func = 0; diff --git a/crates/swc/tests/tsc-references/importAliasModuleExports.2.minified.js b/crates/swc/tests/tsc-references/importAliasModuleExports.2.minified.js index ab0c67da1b59..147f902403d7 100644 --- a/crates/swc/tests/tsc-references/importAliasModuleExports.2.minified.js +++ b/crates/swc/tests/tsc-references/importAliasModuleExports.2.minified.js @@ -10,7 +10,7 @@ var Alias = function() { }(); module.exports = Alias; //// [main.js] -import A from "./mod1"; +import A from './mod1'; A.prototype.foo = 0, A.prototype.func = function() { this._func = 0; }, Object.defineProperty(A.prototype, "def", { diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System.1.normal.js index d40e22cafc01..459fea9d89a0 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System.1.normal.js @@ -17,7 +17,7 @@ System.register([ case 0: return [ 4, - _context.import("./test") // ONE + _context.import('./test') // ONE ]; case 1: req = _state.sent(); @@ -57,7 +57,7 @@ System.register([ case 0: return [ 4, - _context.import("./test") // TWO + _context.import('./test') // TWO ]; case 1: req = _state.sent(); @@ -78,7 +78,7 @@ System.register([ case 0: return [ 4, - _context.import("./test") // THREE + _context.import('./test') // THREE ]; case 1: req = _state.sent(); @@ -100,7 +100,7 @@ System.register([ case 0: return [ 4, - _context.import("./test") // FOUR + _context.import('./test') // FOUR ]; case 1: req = _state.sent(); @@ -120,7 +120,7 @@ System.register([ case 0: return [ 4, - _context.import("./test") // FIVE + _context.import('./test') // FIVE ]; case 1: req = _state.sent(); diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System.2.minified.js index 30f13b18084c..c8b2961c7e0c 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5System.2.minified.js @@ -12,7 +12,7 @@ System.register([ case 0: return [ 4, - _context.import("./test") + _context.import('./test') ]; case 1: return _state.sent(), [ @@ -49,7 +49,7 @@ System.register([ case 0: return [ 4, - _context.import("./test") + _context.import('./test') ]; case 1: return _state.sent(), [ @@ -66,7 +66,7 @@ System.register([ case 0: return [ 4, - _context.import("./test") + _context.import('./test') ]; case 1: return _state.sent(), [ @@ -83,7 +83,7 @@ System.register([ case 0: return [ 4, - _context.import("./test") + _context.import('./test') ]; case 1: return _state.sent(), [ @@ -99,7 +99,7 @@ System.register([ case 0: return [ 4, - _context.import("./test") + _context.import('./test') ]; case 1: return _state.sent(), [ diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD.1.normal.js index 8dcace4b71c2..70434d7df1ef 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD.1.normal.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD.1.normal.js @@ -48,7 +48,7 @@ case 0: return [ 4, - import("./test") // ONE + import('./test') // ONE ]; case 1: req = _state.sent(); @@ -74,7 +74,7 @@ case 0: return [ 4, - import("./test") // TWO + import('./test') // TWO ]; case 1: req = _state.sent(); @@ -95,7 +95,7 @@ case 0: return [ 4, - import("./test") // THREE + import('./test') // THREE ]; case 1: req = _state.sent(); @@ -117,7 +117,7 @@ case 0: return [ 4, - import("./test") // FOUR + import('./test') // FOUR ]; case 1: req = _state.sent(); @@ -137,7 +137,7 @@ case 0: return [ 4, - import("./test") // FIVE + import('./test') // FIVE ]; case 1: req = _state.sent(); diff --git a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD.2.minified.js index f531def8bbda..f5b04b3fa19a 100644 --- a/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD.2.minified.js +++ b/crates/swc/tests/tsc-references/importCallExpressionAsyncES5UMD.2.minified.js @@ -11,7 +11,7 @@ global = this, factory = function(exports1, _async_to_generator, _class_call_che case 0: return [ 4, - import("./test") + import('./test') ]; case 1: return _state.sent(), [ @@ -56,7 +56,7 @@ global = this, factory = function(exports1, _async_to_generator, _class_call_che case 0: return [ 4, - import("./test") + import('./test') ]; case 1: return _state.sent(), [ @@ -73,7 +73,7 @@ global = this, factory = function(exports1, _async_to_generator, _class_call_che case 0: return [ 4, - import("./test") + import('./test') ]; case 1: return _state.sent(), [ @@ -90,7 +90,7 @@ global = this, factory = function(exports1, _async_to_generator, _class_call_che case 0: return [ 4, - import("./test") + import('./test') ]; case 1: return _state.sent(), [ @@ -106,7 +106,7 @@ global = this, factory = function(exports1, _async_to_generator, _class_call_che case 0: return [ 4, - import("./test") + import('./test') ]; case 1: return _state.sent(), [ diff --git a/crates/swc/tests/tsc-references/importClause_default.1.normal.js b/crates/swc/tests/tsc-references/importClause_default.1.normal.js index bc2efffbf011..853d547d226d 100644 --- a/crates/swc/tests/tsc-references/importClause_default.1.normal.js +++ b/crates/swc/tests/tsc-references/importClause_default.1.normal.js @@ -8,7 +8,7 @@ export { A as default }; //// [/b.ts] new A(); var a = { - a: "" + a: '' }; var b = { A: A diff --git a/crates/swc/tests/tsc-references/importEmptyFromModuleNotExisted.1.normal.js b/crates/swc/tests/tsc-references/importEmptyFromModuleNotExisted.1.normal.js index 0607df241296..3dded8188b0d 100644 --- a/crates/swc/tests/tsc-references/importEmptyFromModuleNotExisted.1.normal.js +++ b/crates/swc/tests/tsc-references/importEmptyFromModuleNotExisted.1.normal.js @@ -1,2 +1,2 @@ //// [importEmptyFromModuleNotExisted.ts] -import "module-not-existed"; +import 'module-not-existed'; diff --git a/crates/swc/tests/tsc-references/importEmptyFromModuleNotExisted.2.minified.js b/crates/swc/tests/tsc-references/importEmptyFromModuleNotExisted.2.minified.js index 0607df241296..3dded8188b0d 100644 --- a/crates/swc/tests/tsc-references/importEmptyFromModuleNotExisted.2.minified.js +++ b/crates/swc/tests/tsc-references/importEmptyFromModuleNotExisted.2.minified.js @@ -1,2 +1,2 @@ //// [importEmptyFromModuleNotExisted.ts] -import "module-not-existed"; +import 'module-not-existed'; diff --git a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error.1.normal.js b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error.1.normal.js index 9cb9012a09b8..432ae8b04522 100644 --- a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error.1.normal.js +++ b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error.1.normal.js @@ -26,14 +26,14 @@ var b; console.log(a, b); export { }; // Error //// [/d.ts] -import { A } from "./a"; +import { A } from './a'; var a = A; var b; console.log(a, b); //// [/e.ts] export { }; // noUnusedLocals error only //// [/f.ts] -import { C } from "./a"; +import { C } from './a'; C.One; var c = C.Two; var d = C.Two; diff --git a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error.2.minified.js b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error.2.minified.js index c4f36dedeb25..3015dd482234 100644 --- a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error.2.minified.js +++ b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error.2.minified.js @@ -18,12 +18,12 @@ export { }; console.log(void 0, void 0); export { }; //// [/d.ts] -import { A } from "./a"; +import { A } from './a'; console.log(A, void 0); //// [/e.ts] export { }; //// [/f.ts] -import { C } from "./a"; +import { C } from './a'; C.One, console.log(C.Two, C.Two); //// [/g.ts] console.log(void 0, void 0); diff --git a/crates/swc/tests/tsc-references/inOperatorWithValidOperands.1.normal.js b/crates/swc/tests/tsc-references/inOperatorWithValidOperands.1.normal.js index 30fc63f3a47d..0e60b54fceb3 100644 --- a/crates/swc/tests/tsc-references/inOperatorWithValidOperands.1.normal.js +++ b/crates/swc/tests/tsc-references/inOperatorWithValidOperands.1.normal.js @@ -9,7 +9,7 @@ var a4; var ra1 = x in x; var ra2 = a1 in x; var ra3 = a2 in x; -var ra4 = "" in x; +var ra4 = '' in x; var ra5 = 0 in x; var ra6 = a3 in x; var ra7 = a4 in x; diff --git a/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType.1.normal.js b/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType.1.normal.js index 20d9b53077cf..f3798561b92e 100644 --- a/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType.1.normal.js +++ b/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType.1.normal.js @@ -78,10 +78,10 @@ var Generic; } return D; }(C); - var d = new D(1, ""); + var d = new D(1, ''); var r = d.fn(); var r2 = r.x; var r3 = r.y; - r.y = ""; + r.y = ''; var r6 = d.y(); // error })(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType.2.minified.js b/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType.2.minified.js index da276db37b30..cf2cd885c7f7 100644 --- a/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType.2.minified.js +++ b/crates/swc/tests/tsc-references/instancePropertiesInheritedIntoClassType.2.minified.js @@ -48,4 +48,4 @@ NonGeneric || (NonGeneric = {}), (r = (d = new (function(C) { set: function(v) {} } ]), C; -}()))(1, "")).fn()).x, r1.y, r1.y = "", d1.y(); +}()))(1, '')).fn()).x, r1.y, r1.y = '', d1.y(); diff --git a/crates/swc/tests/tsc-references/instancePropertyInClassType.1.normal.js b/crates/swc/tests/tsc-references/instancePropertyInClassType.1.normal.js index ac74e308563b..147833ae37aa 100644 --- a/crates/swc/tests/tsc-references/instancePropertyInClassType.1.normal.js +++ b/crates/swc/tests/tsc-references/instancePropertyInClassType.1.normal.js @@ -56,10 +56,10 @@ var Generic; ]); return C; }(); - var c = new C(1, ""); + var c = new C(1, ''); var r = c.fn(); var r2 = r.x; var r3 = r.y; - r.y = ""; + r.y = ''; var r6 = c.y(); // error })(Generic || (Generic = {})); diff --git a/crates/swc/tests/tsc-references/instancePropertyInClassType.2.minified.js b/crates/swc/tests/tsc-references/instancePropertyInClassType.2.minified.js index 6604d3d061ae..874d4df0d9a8 100644 --- a/crates/swc/tests/tsc-references/instancePropertyInClassType.2.minified.js +++ b/crates/swc/tests/tsc-references/instancePropertyInClassType.2.minified.js @@ -32,4 +32,4 @@ NonGeneric || (NonGeneric = {}), (r = (c = new (function() { set: function(v) {} } ]), C; -}())(1, "")).fn()).x, r1.y, r1.y = "", c1.y(); +}())(1, '')).fn()).x, r1.y, r1.y = '', c1.y(); diff --git a/crates/swc/tests/tsc-references/instanceofOperatorWithInvalidOperands.1.normal.js b/crates/swc/tests/tsc-references/instanceofOperatorWithInvalidOperands.1.normal.js index ef1f9df63f90..d21bd9963d64 100644 --- a/crates/swc/tests/tsc-references/instanceofOperatorWithInvalidOperands.1.normal.js +++ b/crates/swc/tests/tsc-references/instanceofOperatorWithInvalidOperands.1.normal.js @@ -23,7 +23,7 @@ var ra3 = _instanceof(a3, x); var ra4 = _instanceof(a4, x); var ra5 = _instanceof(0, x); var ra6 = _instanceof(true, x); -var ra7 = _instanceof("", x); +var ra7 = _instanceof('', x); var ra8 = _instanceof(null, x); var ra9 = _instanceof(undefined, x); // invalid right operand @@ -41,9 +41,9 @@ var rb3 = _instanceof(x, b3); var rb4 = _instanceof(x, b4); var rb5 = _instanceof(x, 0); var rb6 = _instanceof(x, true); -var rb7 = _instanceof(x, ""); +var rb7 = _instanceof(x, ''); var rb8 = _instanceof(x, o1); var rb9 = _instanceof(x, o2); var rb10 = _instanceof(x, o3); // both operands are invalid -var rc1 = _instanceof("", {}); +var rc1 = _instanceof('', {}); diff --git a/crates/swc/tests/tsc-references/instanceofOperatorWithInvalidOperands.2.minified.js b/crates/swc/tests/tsc-references/instanceofOperatorWithInvalidOperands.2.minified.js index 9a724686a63a..5e57e3cc2127 100644 --- a/crates/swc/tests/tsc-references/instanceofOperatorWithInvalidOperands.2.minified.js +++ b/crates/swc/tests/tsc-references/instanceofOperatorWithInvalidOperands.2.minified.js @@ -2,4 +2,4 @@ var x, a1, a2, a3, a4, b1, b2, b3, b4, o1, o2, o3; import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; -_instanceof(a1, x), _instanceof(a2, x), _instanceof(a3, x), _instanceof(a4, x), _instanceof(0, x), _instanceof(!0, x), _instanceof("", x), _instanceof(null, x), _instanceof(void 0, x), _instanceof(x, b1), _instanceof(x, b2), _instanceof(x, b3), _instanceof(x, b4), _instanceof(x, 0), _instanceof(x, !0), _instanceof(x, ""), _instanceof(x, o1), _instanceof(x, o2), _instanceof(x, o3), _instanceof("", {}); +_instanceof(a1, x), _instanceof(a2, x), _instanceof(a3, x), _instanceof(a4, x), _instanceof(0, x), _instanceof(!0, x), _instanceof('', x), _instanceof(null, x), _instanceof(void 0, x), _instanceof(x, b1), _instanceof(x, b2), _instanceof(x, b3), _instanceof(x, b4), _instanceof(x, 0), _instanceof(x, !0), _instanceof(x, ''), _instanceof(x, o1), _instanceof(x, o2), _instanceof(x, o3), _instanceof('', {}); diff --git a/crates/swc/tests/tsc-references/interfaceWithOverloadedCallAndConstructSignatures.1.normal.js b/crates/swc/tests/tsc-references/interfaceWithOverloadedCallAndConstructSignatures.1.normal.js index d6e8a9328955..0a141c85f830 100644 --- a/crates/swc/tests/tsc-references/interfaceWithOverloadedCallAndConstructSignatures.1.normal.js +++ b/crates/swc/tests/tsc-references/interfaceWithOverloadedCallAndConstructSignatures.1.normal.js @@ -1,6 +1,6 @@ //// [interfaceWithOverloadedCallAndConstructSignatures.ts] var f; var r1 = f(); -var r2 = f(""); +var r2 = f(''); var r3 = new f(); -var r4 = new f(""); +var r4 = new f(''); diff --git a/crates/swc/tests/tsc-references/interfaceWithOverloadedCallAndConstructSignatures.2.minified.js b/crates/swc/tests/tsc-references/interfaceWithOverloadedCallAndConstructSignatures.2.minified.js index 2ab159e87ab4..a92cdd445422 100644 --- a/crates/swc/tests/tsc-references/interfaceWithOverloadedCallAndConstructSignatures.2.minified.js +++ b/crates/swc/tests/tsc-references/interfaceWithOverloadedCallAndConstructSignatures.2.minified.js @@ -1,3 +1,3 @@ //// [interfaceWithOverloadedCallAndConstructSignatures.ts] var f; -f(), f(""), new f(), new f(""); +f(), f(''), new f(), new f(''); diff --git a/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType.1.normal.js b/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType.1.normal.js index 008e85514ff8..115a9906c006 100644 --- a/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType.1.normal.js +++ b/crates/swc/tests/tsc-references/interfaceWithPropertyOfEveryType.1.normal.js @@ -15,7 +15,7 @@ var E; })(E || (E = {})); var a = { a: 1, - b: "", + b: '', c: true, d: {}, e: null, diff --git a/crates/swc/tests/tsc-references/interfaceWithSpecializedCallAndConstructSignatures.1.normal.js b/crates/swc/tests/tsc-references/interfaceWithSpecializedCallAndConstructSignatures.1.normal.js index 7a6308812b9b..30be5b94dec8 100644 --- a/crates/swc/tests/tsc-references/interfaceWithSpecializedCallAndConstructSignatures.1.normal.js +++ b/crates/swc/tests/tsc-references/interfaceWithSpecializedCallAndConstructSignatures.1.normal.js @@ -1,6 +1,6 @@ //// [interfaceWithSpecializedCallAndConstructSignatures.ts] var f; -var r = f("a"); -var r2 = f("A"); -var r3 = new f("a"); -var r4 = new f("A"); +var r = f('a'); +var r2 = f('A'); +var r3 = new f('a'); +var r4 = new f('A'); diff --git a/crates/swc/tests/tsc-references/interfaceWithSpecializedCallAndConstructSignatures.2.minified.js b/crates/swc/tests/tsc-references/interfaceWithSpecializedCallAndConstructSignatures.2.minified.js index 8d3b5f28d250..42dd39177e42 100644 --- a/crates/swc/tests/tsc-references/interfaceWithSpecializedCallAndConstructSignatures.2.minified.js +++ b/crates/swc/tests/tsc-references/interfaceWithSpecializedCallAndConstructSignatures.2.minified.js @@ -1,3 +1,3 @@ //// [interfaceWithSpecializedCallAndConstructSignatures.ts] var f; -f("a"), f("A"), new f("a"), new f("A"); +f('a'), f('A'), new f('a'), new f('A'); diff --git a/crates/swc/tests/tsc-references/intersectionAsWeakTypeSource.1.normal.js b/crates/swc/tests/tsc-references/intersectionAsWeakTypeSource.1.normal.js index c925eadc4159..4d6ce420d90d 100644 --- a/crates/swc/tests/tsc-references/intersectionAsWeakTypeSource.1.normal.js +++ b/crates/swc/tests/tsc-references/intersectionAsWeakTypeSource.1.normal.js @@ -1,6 +1,6 @@ //// [intersectionAsWeakTypeSource.ts] var xy = { - x: "x", + x: 'x', y: 10 }; var z1 = xy; // error, {xy} doesn't overlap with {z} diff --git a/crates/swc/tests/tsc-references/intersectionReduction.1.normal.js b/crates/swc/tests/tsc-references/intersectionReduction.1.normal.js index 9f534d2dba82..26501081a831 100644 --- a/crates/swc/tests/tsc-references/intersectionReduction.1.normal.js +++ b/crates/swc/tests/tsc-references/intersectionReduction.1.normal.js @@ -5,15 +5,15 @@ var r1 = f10(a1); // unknown var r2 = f10(a2); // string // Repro from #31663 var x1 = { - a: "foo", + a: 'foo', b: 42 }; var x2 = { - a: "foo", + a: 'foo', b: true }; -x1[k] = "bar"; // Error -x2[k] = "bar"; // Error +x1[k] = 'bar'; // Error +x2[k] = 'bar'; // Error var Tag1; var Tag2; s1 = s2; diff --git a/crates/swc/tests/tsc-references/intersectionReductionStrict.1.normal.js b/crates/swc/tests/tsc-references/intersectionReductionStrict.1.normal.js index 3bf7c326c477..fab5c57d6ec7 100644 --- a/crates/swc/tests/tsc-references/intersectionReductionStrict.1.normal.js +++ b/crates/swc/tests/tsc-references/intersectionReductionStrict.1.normal.js @@ -3,15 +3,15 @@ ab.kind; // Error var a = x; // Repro from #31663 var x1 = { - a: "foo", + a: 'foo', b: 42 }; var x2 = { - a: "foo", + a: 'foo', b: true }; -x1[k] = "bar"; // Error -x2[k] = "bar"; // Error +x1[k] = 'bar'; // Error +x2[k] = 'bar'; // Error var Tag1; var Tag2; s1 = s2; diff --git a/crates/swc/tests/tsc-references/intersectionTypeInference2.1.normal.js b/crates/swc/tests/tsc-references/intersectionTypeInference2.1.normal.js index dea6cab48380..c637d348147e 100644 --- a/crates/swc/tests/tsc-references/intersectionTypeInference2.1.normal.js +++ b/crates/swc/tests/tsc-references/intersectionTypeInference2.1.normal.js @@ -1,5 +1,5 @@ //// [intersectionTypeInference2.ts] f(a); // never f(b); // never -f2(obj, "a"); -f2(obj, "b"); +f2(obj, 'a'); +f2(obj, 'b'); diff --git a/crates/swc/tests/tsc-references/intersectionTypeInference2.2.minified.js b/crates/swc/tests/tsc-references/intersectionTypeInference2.2.minified.js index 783fccdc3a74..76fe497e05b5 100644 --- a/crates/swc/tests/tsc-references/intersectionTypeInference2.2.minified.js +++ b/crates/swc/tests/tsc-references/intersectionTypeInference2.2.minified.js @@ -1,2 +1,2 @@ //// [intersectionTypeInference2.ts] -f(a), f(b), f2(obj, "a"), f2(obj, "b"); +f(a), f(b), f2(obj, 'a'), f2(obj, 'b'); diff --git a/crates/swc/tests/tsc-references/intersectionTypeMembers.1.normal.js b/crates/swc/tests/tsc-references/intersectionTypeMembers.1.normal.js index 64125f02affb..218c470a4afe 100644 --- a/crates/swc/tests/tsc-references/intersectionTypeMembers.1.normal.js +++ b/crates/swc/tests/tsc-references/intersectionTypeMembers.1.normal.js @@ -15,8 +15,8 @@ var n = f(42); var de = { nested: { doublyNested: { - d: "yes", - f: "no" + d: 'yes', + f: 'no' }, different: { e: 12 @@ -29,10 +29,10 @@ var de = { var defg = { nested: { doublyNested: { - d: "yes", - f: "no", - g: "ok", - h: "affirmative" + d: 'yes', + f: 'no', + g: 'ok', + h: 'affirmative' }, different: { e: 12 diff --git a/crates/swc/tests/tsc-references/intlNumberFormatES5UseGrouping.1.normal.js b/crates/swc/tests/tsc-references/intlNumberFormatES5UseGrouping.1.normal.js index 97294df9f709..a25bcf963b36 100644 --- a/crates/swc/tests/tsc-references/intlNumberFormatES5UseGrouping.1.normal.js +++ b/crates/swc/tests/tsc-references/intlNumberFormatES5UseGrouping.1.normal.js @@ -1,11 +1,11 @@ //// [intlNumberFormatES5UseGrouping.ts] -new Intl.NumberFormat("en-GB", { +new Intl.NumberFormat('en-GB', { useGrouping: true }); -new Intl.NumberFormat("en-GB", { - useGrouping: "true" +new Intl.NumberFormat('en-GB', { + useGrouping: 'true' }); // expect error -new Intl.NumberFormat("en-GB", { - useGrouping: "always" +new Intl.NumberFormat('en-GB', { + useGrouping: 'always' }); // expect error -var useGrouping = new Intl.NumberFormat("en-GB").resolvedOptions().useGrouping; +var useGrouping = new Intl.NumberFormat('en-GB').resolvedOptions().useGrouping; diff --git a/crates/swc/tests/tsc-references/intlNumberFormatES5UseGrouping.2.minified.js b/crates/swc/tests/tsc-references/intlNumberFormatES5UseGrouping.2.minified.js index db0f4a2441e4..839a5b739f84 100644 --- a/crates/swc/tests/tsc-references/intlNumberFormatES5UseGrouping.2.minified.js +++ b/crates/swc/tests/tsc-references/intlNumberFormatES5UseGrouping.2.minified.js @@ -1,8 +1,8 @@ //// [intlNumberFormatES5UseGrouping.ts] -new Intl.NumberFormat("en-GB", { +new Intl.NumberFormat('en-GB', { useGrouping: !0 -}), new Intl.NumberFormat("en-GB", { - useGrouping: "true" -}), new Intl.NumberFormat("en-GB", { - useGrouping: "always" -}), new Intl.NumberFormat("en-GB").resolvedOptions().useGrouping; +}), new Intl.NumberFormat('en-GB', { + useGrouping: 'true' +}), new Intl.NumberFormat('en-GB', { + useGrouping: 'always' +}), new Intl.NumberFormat('en-GB').resolvedOptions().useGrouping; diff --git a/crates/swc/tests/tsc-references/intraExpressionInferences.1.normal.js b/crates/swc/tests/tsc-references/intraExpressionInferences.1.normal.js index 90b588ef416c..246112eec8e0 100644 --- a/crates/swc/tests/tsc-references/intraExpressionInferences.1.normal.js +++ b/crates/swc/tests/tsc-references/intraExpressionInferences.1.normal.js @@ -87,7 +87,7 @@ test({ return 0; }, b: function(a) { - return "a"; + return 'a'; }, c: function(b) { var _$x = b; diff --git a/crates/swc/tests/tsc-references/intrinsicKeyword.1.normal.js b/crates/swc/tests/tsc-references/intrinsicKeyword.1.normal.js index 7d1334711bd4..f7f5e693a686 100644 --- a/crates/swc/tests/tsc-references/intrinsicKeyword.1.normal.js +++ b/crates/swc/tests/tsc-references/intrinsicKeyword.1.normal.js @@ -8,5 +8,5 @@ function f2(intrinsic) { return intrinsic; } function f3() { - var s1 = "ok"; + var s1 = 'ok'; } diff --git a/crates/swc/tests/tsc-references/invalidAssignmentsToVoid.1.normal.js b/crates/swc/tests/tsc-references/invalidAssignmentsToVoid.1.normal.js index 0f5651ef9641..c2ad61a4cb73 100644 --- a/crates/swc/tests/tsc-references/invalidAssignmentsToVoid.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidAssignmentsToVoid.1.normal.js @@ -3,7 +3,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var x; x = 1; x = true; -x = ""; +x = ''; x = {}; var C = function C() { "use strict"; diff --git a/crates/swc/tests/tsc-references/invalidEnumAssignments.1.normal.js b/crates/swc/tests/tsc-references/invalidEnumAssignments.1.normal.js index 82355927bd04..24dfff162264 100644 --- a/crates/swc/tests/tsc-references/invalidEnumAssignments.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidEnumAssignments.1.normal.js @@ -15,7 +15,7 @@ e = 0; e2 = 0; e = null; e = {}; -e = ""; +e = ''; function f(a) { e = a; } diff --git a/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations.1.normal.js b/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations.1.normal.js index 8628c740952c..b08b3654fe1d 100644 --- a/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidMultipleVariableDeclarations.1.normal.js @@ -38,7 +38,7 @@ var M; // all of these are errors var a; var a = 1; -var a = "a string"; +var a = 'a string'; var a = new C(); var a = new D(); var a = M; @@ -47,7 +47,7 @@ var b = new C(); var b = new C2(); var f = F; var f = function(x) { - return ""; + return ''; }; var arr; var arr = [ diff --git a/crates/swc/tests/tsc-references/invalidStringAssignments.1.normal.js b/crates/swc/tests/tsc-references/invalidStringAssignments.1.normal.js index b865bf1e4cd7..e7021b043e29 100644 --- a/crates/swc/tests/tsc-references/invalidStringAssignments.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidStringAssignments.1.normal.js @@ -1,6 +1,6 @@ //// [invalidStringAssignments.ts] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; -var x = ""; +var x = ''; var a = x; var b = x; var c = x; diff --git a/crates/swc/tests/tsc-references/invalidStringAssignments.2.minified.js b/crates/swc/tests/tsc-references/invalidStringAssignments.2.minified.js index 2c37840dfc8c..6600aaf3c18d 100644 --- a/crates/swc/tests/tsc-references/invalidStringAssignments.2.minified.js +++ b/crates/swc/tests/tsc-references/invalidStringAssignments.2.minified.js @@ -1,4 +1,4 @@ //// [invalidStringAssignments.ts] var M, E, E1; import "@swc/helpers/_/_class_call_check"; -(M || (M = {})).x = 1, M = "", (E1 = E || (E = {}))[E1.A = 0] = "A"; +(M || (M = {})).x = 1, M = '', (E1 = E || (E = {}))[E1.A = 0] = "A"; diff --git a/crates/swc/tests/tsc-references/invalidUndefinedValues.1.normal.js b/crates/swc/tests/tsc-references/invalidUndefinedValues.1.normal.js index e167fb9d4dda..e369763e0927 100644 --- a/crates/swc/tests/tsc-references/invalidUndefinedValues.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidUndefinedValues.1.normal.js @@ -2,7 +2,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var x; x = 1; -x = ""; +x = ''; x = true; var a; x = a; diff --git a/crates/swc/tests/tsc-references/invalidVoidValues.1.normal.js b/crates/swc/tests/tsc-references/invalidVoidValues.1.normal.js index 2ff4d0979d62..720c9436f871 100644 --- a/crates/swc/tests/tsc-references/invalidVoidValues.1.normal.js +++ b/crates/swc/tests/tsc-references/invalidVoidValues.1.normal.js @@ -2,7 +2,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var x; x = 1; -x = ""; +x = ''; x = true; var E; (function(E) { diff --git a/crates/swc/tests/tsc-references/isomorphicMappedTypeInference.1.normal.js b/crates/swc/tests/tsc-references/isomorphicMappedTypeInference.1.normal.js index 5b6e8614d370..2da0b8a9b629 100644 --- a/crates/swc/tests/tsc-references/isomorphicMappedTypeInference.1.normal.js +++ b/crates/swc/tests/tsc-references/isomorphicMappedTypeInference.1.normal.js @@ -157,10 +157,10 @@ function getProps(obj, list) { } var myAny = {}; var o1 = getProps(myAny, [ - "foo", - "bar" + 'foo', + 'bar' ]); var o2 = getProps(myAny, [ - "foo", - "bar" + 'foo', + 'bar' ]); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsCommonjsRelativePath.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsCommonjsRelativePath.1.normal.js index 36b3335b9f38..8a3d591ab0e3 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsCommonjsRelativePath.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsCommonjsRelativePath.1.normal.js @@ -1,5 +1,5 @@ //// [thing.js] -"use strict"; +'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); @@ -11,8 +11,8 @@ module.exports = { Thing: Thing }; //// [reexport.js] -"use strict"; -var Thing = require("./thing").Thing; +'use strict'; +var Thing = require('./thing').Thing; module.exports = { Thing: Thing }; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsCommonjsRelativePath.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsCommonjsRelativePath.2.minified.js index 95b25acce481..dd8c4f004dbe 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsCommonjsRelativePath.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsCommonjsRelativePath.2.minified.js @@ -9,7 +9,7 @@ module.exports = { } }; //// [reexport.js] -var Thing = require("./thing").Thing; +var Thing = require('./thing').Thing; module.exports = { Thing: Thing }; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsDocCommentsOnConsts.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsDocCommentsOnConsts.1.normal.js index 7db83d788ccd..74d8730ac8dd 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsDocCommentsOnConsts.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsDocCommentsOnConsts.1.normal.js @@ -2,7 +2,7 @@ /** * const doc comment */ var x = function(a) { - return ""; + return ''; }; /** * function doc comment diff --git a/crates/swc/tests/tsc-references/jsDeclarationsDocCommentsOnConsts.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsDocCommentsOnConsts.2.minified.js index 5a61a8883ad0..d35a99746228 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsDocCommentsOnConsts.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsDocCommentsOnConsts.2.minified.js @@ -1,7 +1,7 @@ //// [index1.js] module.exports = { x: function(a) { - return ""; + return ''; }, b: function() { return 0; diff --git a/crates/swc/tests/tsc-references/jsDeclarationsEnumTag.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsEnumTag.1.normal.js index 632c5d6409f1..ffab14735de0 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsEnumTag.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsEnumTag.1.normal.js @@ -29,7 +29,7 @@ /** @type {number} */ var num = s; /** @type {(n: number) => number} */ var fun = f; /** @type {Target} */ var v = Target.START; - v = "something else" // allowed, like Typescript's classic enums and unlike its string enums + v = 'something else' // allowed, like Typescript's classic enums and unlike its string enums ; } /** @param {string} s */ export function ff(s) { diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignmentWithKeywordName.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignmentWithKeywordName.1.normal.js index 3d37f1c0f5e6..981d9ad85068 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignmentWithKeywordName.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignmentWithKeywordName.1.normal.js @@ -1,10 +1,10 @@ //// [index.js] var x = 12; module.exports = { - extends: "base", + extends: 'base', more: { others: [ - "strs" + 'strs' ] }, x: x diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignmentWithKeywordName.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignmentWithKeywordName.2.minified.js index a31260d377d9..d75854d38d85 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignmentWithKeywordName.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignmentWithKeywordName.2.minified.js @@ -1,9 +1,9 @@ //// [index.js] module.exports = { - extends: "base", + extends: 'base', more: { others: [ - "strs" + 'strs' ] }, x: 12 diff --git a/crates/swc/tests/tsc-references/jsDeclarationsReexportedCjsAlias.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsReexportedCjsAlias.1.normal.js index 8fac99f6a42b..90bda97fc170 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsReexportedCjsAlias.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsReexportedCjsAlias.1.normal.js @@ -21,7 +21,7 @@ module.exports = { SomeClass: SomeClass }; //// [main.js] -var _require = require("./lib"), SomeClass = _require.SomeClass, Another = _require.SomeClass; +var _require = require('./lib'), SomeClass = _require.SomeClass, Another = _require.SomeClass; module.exports = { SomeClass: SomeClass, Another: Another diff --git a/crates/swc/tests/tsc-references/jsDeclarationsReexportedCjsAlias.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsReexportedCjsAlias.2.minified.js index 40a681d5842f..e02607365234 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsReexportedCjsAlias.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsReexportedCjsAlias.2.minified.js @@ -15,7 +15,7 @@ module.exports = { SomeClass: SomeClass }; //// [main.js] -var _require = require("./lib"), SomeClass = _require.SomeClass, Another = _require.SomeClass; +var _require = require('./lib'), SomeClass = _require.SomeClass, Another = _require.SomeClass; module.exports = { SomeClass: SomeClass, Another: Another diff --git a/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile.1.normal.js index 2b855ca2e67a..b6cd4a11c3a0 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile.1.normal.js @@ -10,7 +10,7 @@ module.exports = { }; //// [index.js] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; -var Rectangle = require("./rectangle").Rectangle; +var Rectangle = require('./rectangle').Rectangle; var Render = /*#__PURE__*/ function() { "use strict"; function Render() { diff --git a/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile.2.minified.js index 03e3fa4340bd..ea5ea9fe5620 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile.2.minified.js @@ -7,7 +7,7 @@ module.exports = { }; //// [index.js] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; -var Rectangle = require("./rectangle").Rectangle, Render = function() { +var Rectangle = require('./rectangle').Rectangle, Render = function() { function Render() { _class_call_check(this, Render), this.objects = []; } diff --git a/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor.1.normal.js index 1f36f7d056d9..23a326ffec18 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor.1.normal.js @@ -12,7 +12,7 @@ export var Sub = /*#__PURE__*/ function(Super) { var _super = _create_super(Sub); function Sub() { _class_call_check(this, Sub); - return _super.call(this, "first", "second"); + return _super.call(this, 'first', 'second'); } return Sub; }(Super); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor.2.minified.js index 7b09f4ff4a84..fe3683f995f4 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsSubclassWithExplicitNoArgumentConstructor.2.minified.js @@ -9,7 +9,7 @@ export var Sub = function(Super) { _inherits(Sub, Super); var _super = _create_super(Sub); function Sub() { - return _class_call_check(this, Sub), _super.call(this, "first", "second"); + return _class_call_check(this, Sub), _super.call(this, 'first', 'second'); } return Sub; }(Super); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment.1.normal.js index 60ae0d233db7..88735244da94 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment.1.normal.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment.1.normal.js @@ -8,12 +8,12 @@ * @type {{[P in TaskGroupIds]: {id: P, label: string}}} */ var taskGroups = { parseHTML: { - id: "parseHTML", - label: "Parse HTML & CSS" + id: 'parseHTML', + label: 'Parse HTML & CSS' }, styleLayout: { - id: "styleLayout", - label: "Style & Layout" + id: 'styleLayout', + label: 'Style & Layout' } }; /** @type {Object} */ var taskNameToGroup = {}; @@ -23,7 +23,7 @@ module.exports = { }; //// [index.js] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; -var _require = require("./module.js"), taskGroups = _require.taskGroups, taskNameToGroup = _require.taskNameToGroup; +var _require = require('./module.js'), taskGroups = _require.taskGroups, taskNameToGroup = _require.taskNameToGroup; /** @typedef {import('./module.js').TaskGroup} TaskGroup */ /** * @typedef TaskNode * @prop {TaskNode[]} children diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment.2.minified.js index f3d70e964516..82eadce2fcf3 100644 --- a/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment.2.minified.js +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment.2.minified.js @@ -2,19 +2,19 @@ module.exports = { taskGroups: { parseHTML: { - id: "parseHTML", - label: "Parse HTML & CSS" + id: 'parseHTML', + label: 'Parse HTML & CSS' }, styleLayout: { - id: "styleLayout", - label: "Style & Layout" + id: 'styleLayout', + label: 'Style & Layout' } }, taskNameToGroup: {} }; //// [index.js] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; -var _require = require("./module.js"); +var _require = require('./module.js'); _require.taskGroups, _require.taskNameToGroup, module.exports = function MainThreadTasks(x, y) { _class_call_check(this, MainThreadTasks); }; diff --git a/crates/swc/tests/tsc-references/keyofAndIndexedAccess.1.normal.js b/crates/swc/tests/tsc-references/keyofAndIndexedAccess.1.normal.js index 78f21fcc8636..81754e438536 100644 --- a/crates/swc/tests/tsc-references/keyofAndIndexedAccess.1.normal.js +++ b/crates/swc/tests/tsc-references/keyofAndIndexedAccess.1.normal.js @@ -155,9 +155,9 @@ function f60(source, target) { } } function f70(func) { - func("a", "a"); - func("a", "b"); - func("a", "c"); + func('a', 'a'); + func('a', 'b'); + func('a', 'c'); } function f71(func) { var x = func({ @@ -176,19 +176,19 @@ function f72(func) { b: "hello" }, { c: true - }, "a"); // number + }, 'a'); // number var b = func({ a: 1, b: "hello" }, { c: true - }, "b"); // string + }, 'b'); // string var c = func({ a: 1, b: "hello" }, { c: true - }, "c"); // boolean + }, 'c'); // boolean } function f73(func) { var a = func({ @@ -196,19 +196,19 @@ function f73(func) { b: "hello" }, { c: true - }, "a"); // number + }, 'a'); // number var b = func({ a: 1, b: "hello" }, { c: true - }, "b"); // string + }, 'b'); // string var c = func({ a: 1, b: "hello" }, { c: true - }, "c"); // boolean + }, 'c'); // boolean } function f74(func) { var a = func({ @@ -217,25 +217,25 @@ function f74(func) { }, { a: 2, b: true - }, "a"); // number + }, 'a'); // number var b = func({ a: 1, b: "hello" }, { a: 2, b: true - }, "b"); // string | boolean + }, 'b'); // string | boolean } function f80(obj) { var a1 = obj.a; // { x: any } - var a2 = obj["a"]; // { x: any } - var a3 = obj["a"]; // T["a"] + var a2 = obj['a']; // { x: any } + var a3 = obj['a']; // T["a"] var x1 = obj.a.x; // any - var x2 = obj["a"]["x"]; // any - var x3 = obj["a"]["x"]; // T["a"]["x"] + var x2 = obj['a']['x']; // any + var x3 = obj['a']['x']; // T["a"]["x"] } function f81(obj) { - return obj["a"]["x"]; + return obj['a']['x']; } function f82() { var x1 = f81({ @@ -250,7 +250,7 @@ function f82() { }); // number } function f83(obj, key) { - return obj[key]["x"]; + return obj[key]['x']; } function f84() { var x1 = f83({ @@ -383,13 +383,13 @@ function path(obj) { return result; } function f1(thing) { - var x1 = path(thing, "a"); // { x: number, y: string } - var x2 = path(thing, "a", "y"); // string - var x3 = path(thing, "b"); // boolean + var x1 = path(thing, 'a'); // { x: number, y: string } + var x2 = path(thing, 'a', 'y'); // string + var x3 = path(thing, 'b'); // boolean var x4 = path.apply(void 0, [ thing, - "a", - "x" + 'a', + 'x' ]); // any } // Repro from comment in #12114 @@ -425,7 +425,7 @@ function addToMyThingy(key) { MyThingy[key].push("a"); } function onChangeGenericFunction(handler) { - handler.onChange("preset"); + handler.onChange('preset'); } // Repro from #13285 function updateIds(obj, idFields, idMapping) { diff --git a/crates/swc/tests/tsc-references/keyofAndIndexedAccessErrors.1.normal.js b/crates/swc/tests/tsc-references/keyofAndIndexedAccessErrors.1.normal.js index 84d5ed2a621e..2d999a74d94e 100644 --- a/crates/swc/tests/tsc-references/keyofAndIndexedAccessErrors.1.normal.js +++ b/crates/swc/tests/tsc-references/keyofAndIndexedAccessErrors.1.normal.js @@ -64,8 +64,8 @@ function f4(k) { k = 42; // error k = "hello"; // error } -var a1 = "a"; // Error -var b1 = "b"; +var a1 = 'a'; // Error +var b1 = 'b'; function test1(t, k) { t[k] = 42; // Error t[k] = "hello"; // Error diff --git a/crates/swc/tests/tsc-references/keyofInferenceIntersectsResults.1.normal.js b/crates/swc/tests/tsc-references/keyofInferenceIntersectsResults.1.normal.js index 5dd1628f3899..c7a7e9144257 100644 --- a/crates/swc/tests/tsc-references/keyofInferenceIntersectsResults.1.normal.js +++ b/crates/swc/tests/tsc-references/keyofInferenceIntersectsResults.1.normal.js @@ -1,4 +1,4 @@ //// [keyofInferenceIntersectsResults.ts] -var a = foo("a", "b"); // compiles cleanly -var b = foo("a", "b"); // also clean -var c = bar("a", "b"); // still clean +var a = foo('a', 'b'); // compiles cleanly +var b = foo('a', 'b'); // also clean +var c = bar('a', 'b'); // still clean diff --git a/crates/swc/tests/tsc-references/keyofInferenceIntersectsResults.2.minified.js b/crates/swc/tests/tsc-references/keyofInferenceIntersectsResults.2.minified.js index 58335eec9ba2..4fd832d7d582 100644 --- a/crates/swc/tests/tsc-references/keyofInferenceIntersectsResults.2.minified.js +++ b/crates/swc/tests/tsc-references/keyofInferenceIntersectsResults.2.minified.js @@ -1,2 +1,2 @@ //// [keyofInferenceIntersectsResults.ts] -foo("a", "b"), foo("a", "b"), bar("a", "b"); +foo('a', 'b'), foo('a', 'b'), bar('a', 'b'); diff --git a/crates/swc/tests/tsc-references/literalTypeWidening.1.normal.js b/crates/swc/tests/tsc-references/literalTypeWidening.1.normal.js index c95ccebfb003..964bef9fd073 100644 --- a/crates/swc/tests/tsc-references/literalTypeWidening.1.normal.js +++ b/crates/swc/tests/tsc-references/literalTypeWidening.1.normal.js @@ -57,12 +57,12 @@ function f5() { var v4 = c4; } function f6(cond) { - var x1 = widening("a"); + var x1 = widening('a'); var x2 = widening(10); - var x3 = widening(cond ? "a" : 10); - var y1 = nonWidening("a"); + var x3 = widening(cond ? 'a' : 10); + var y1 = nonWidening('a'); var y2 = nonWidening(10); - var y3 = nonWidening(cond ? "a" : 10); + var y3 = nonWidening(cond ? 'a' : 10); } var FAILURE = "FAILURE"; function doWork() { @@ -99,7 +99,7 @@ export function Set() { export function keys(obj) { return Object.keys(obj); } -var langCodeSet = Set("fr", "en", "es", "it", "nl"); +var langCodeSet = Set('fr', 'en', 'es', 'it', 'nl'); export var langCodes = keys(langCodeSet); var arr = langCodes.map(function(code) { return { @@ -112,7 +112,7 @@ function test(obj) { "a" ]); return _object_spread({ - a: "hello" + a: 'hello' }, rest); } var E; diff --git a/crates/swc/tests/tsc-references/literalTypeWidening.2.minified.js b/crates/swc/tests/tsc-references/literalTypeWidening.2.minified.js index 0b077455102b..cb7b3d319506 100644 --- a/crates/swc/tests/tsc-references/literalTypeWidening.2.minified.js +++ b/crates/swc/tests/tsc-references/literalTypeWidening.2.minified.js @@ -11,7 +11,7 @@ export function Set() { export function keys(obj) { return Object.keys(obj); } -var E, E1, langCodeSet = Set("fr", "en", "es", "it", "nl"); +var E, E1, langCodeSet = Set('fr', 'en', 'es', 'it', 'nl'); export var langCodes = keys(langCodeSet); langCodes.map(function(code) { return { diff --git a/crates/swc/tests/tsc-references/literalTypesAndDestructuring.1.normal.js b/crates/swc/tests/tsc-references/literalTypesAndDestructuring.1.normal.js index 7556c849ecf0..e3116c59a3d5 100644 --- a/crates/swc/tests/tsc-references/literalTypesAndDestructuring.1.normal.js +++ b/crates/swc/tests/tsc-references/literalTypesAndDestructuring.1.normal.js @@ -10,5 +10,5 @@ var _x_a1; var b3 = (_x_a1 = x.a) !== null && _x_a1 !== void 0 ? _x_a1 : 2; var _x_a2; var b4 = (_x_a2 = x.a) !== null && _x_a2 !== void 0 ? _x_a2 : 2; -var _ref = {}, _ref_bar = _ref.bar, bar = _ref_bar === void 0 ? "yo" : _ref_bar; +var _ref = {}, _ref_bar = _ref.bar, bar = _ref_bar === void 0 ? 'yo' : _ref_bar; bar; // "yo" | "ha" diff --git a/crates/swc/tests/tsc-references/logicalOrExpressionIsContextuallyTyped.1.normal.js b/crates/swc/tests/tsc-references/logicalOrExpressionIsContextuallyTyped.1.normal.js index d2a377bb110d..e1f93786319e 100644 --- a/crates/swc/tests/tsc-references/logicalOrExpressionIsContextuallyTyped.1.normal.js +++ b/crates/swc/tests/tsc-references/logicalOrExpressionIsContextuallyTyped.1.normal.js @@ -4,9 +4,9 @@ // same type and the result is of the best common type of the contextual type and the two // operand types. var r = { - a: "", + a: '', b: 123 } || { - a: "", + a: '', b: true }; diff --git a/crates/swc/tests/tsc-references/logicalOrOperatorWithTypeParameters.1.normal.js b/crates/swc/tests/tsc-references/logicalOrOperatorWithTypeParameters.1.normal.js index c809c0d16677..327f9757a00b 100644 --- a/crates/swc/tests/tsc-references/logicalOrOperatorWithTypeParameters.1.normal.js +++ b/crates/swc/tests/tsc-references/logicalOrOperatorWithTypeParameters.1.normal.js @@ -18,7 +18,7 @@ function fn3(t, u) { var r1 = t || u; var r2 = t || u; var r3 = t || { - a: "" + a: '' }; var r4 = t || u; } diff --git a/crates/swc/tests/tsc-references/mappedTypeErrors.1.normal.js b/crates/swc/tests/tsc-references/mappedTypeErrors.1.normal.js index 3da463983539..51a40c96f75a 100644 --- a/crates/swc/tests/tsc-references/mappedTypeErrors.1.normal.js +++ b/crates/swc/tests/tsc-references/mappedTypeErrors.1.normal.js @@ -134,13 +134,13 @@ c.setState({ c: true }); // Error var x1 = { - a: "no" + a: 'no' }; // Error var x2 = { - a: "no" + a: 'no' }; // Error var x3 = { - a: "no" + a: 'no' }; // Error var o = { x: 5, diff --git a/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads.1.normal.js b/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads.1.normal.js index 452740b0f74d..75773feb44c1 100644 --- a/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads.1.normal.js +++ b/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads.1.normal.js @@ -29,4 +29,4 @@ var r = c.foo(1); // error var d; var r2 = d.foo(2); // error var r3 = C.foo(1); // error -var r4 = D.bar(""); // error +var r4 = D.bar(''); // error diff --git a/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads.2.minified.js b/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads.2.minified.js index 1f71f79ba6cd..d1f1b6e8e7b6 100644 --- a/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads.2.minified.js +++ b/crates/swc/tests/tsc-references/memberFunctionsWithPrivateOverloads.2.minified.js @@ -13,4 +13,4 @@ var c, d, C = function() { var _proto = D.prototype; return _proto.foo = function(x, y) {}, _proto.bar = function(x, y) {}, D.foo = function(x, y) {}, D.bar = function(x, y) {}, D; }(); -c.foo(1), d.foo(2), C.foo(1), D.bar(""); +c.foo(1), d.foo(2), C.foo(1), D.bar(''); diff --git a/crates/swc/tests/tsc-references/mergedInterfacesWithIndexers.1.normal.js b/crates/swc/tests/tsc-references/mergedInterfacesWithIndexers.1.normal.js index b4718d56f68a..d51b5d7f3dc9 100644 --- a/crates/swc/tests/tsc-references/mergedInterfacesWithIndexers.1.normal.js +++ b/crates/swc/tests/tsc-references/mergedInterfacesWithIndexers.1.normal.js @@ -2,5 +2,5 @@ // indexers should behave like other members when merging interface declarations var a; var r = a[1]; -var r2 = a["1"]; -var r3 = a["hi"]; +var r2 = a['1']; +var r3 = a['hi']; diff --git a/crates/swc/tests/tsc-references/mergedInterfacesWithIndexers.2.minified.js b/crates/swc/tests/tsc-references/mergedInterfacesWithIndexers.2.minified.js index 1404e4a8323e..47127ea0aace 100644 --- a/crates/swc/tests/tsc-references/mergedInterfacesWithIndexers.2.minified.js +++ b/crates/swc/tests/tsc-references/mergedInterfacesWithIndexers.2.minified.js @@ -1,3 +1,3 @@ //// [mergedInterfacesWithIndexers.ts] var a; -a[1], a["1"], a.hi; +a[1], a['1'], a.hi; diff --git a/crates/swc/tests/tsc-references/moduleExportAlias4.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAlias4.1.normal.js index 5e4b03abf2cd..a21799773c78 100644 --- a/crates/swc/tests/tsc-references/moduleExportAlias4.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAlias4.1.normal.js @@ -1,7 +1,7 @@ //// [bug24024.js] // #24024 import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; -var wat = require("./bug24024"); +var wat = require('./bug24024'); module.exports = function C() { "use strict"; _class_call_check(this, C); diff --git a/crates/swc/tests/tsc-references/moduleExportAlias4.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAlias4.2.minified.js index 781c225b7ede..39863fcf00af 100644 --- a/crates/swc/tests/tsc-references/moduleExportAlias4.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportAlias4.2.minified.js @@ -1,6 +1,6 @@ //// [bug24024.js] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; -require("./bug24024"), module.exports = function C() { +require('./bug24024'), module.exports = function C() { _class_call_check(this, C); }, module.exports.D = function D() { _class_call_check(this, D); diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAssignment.1.normal.js index ffb4c8ff2719..1da8839cb89c 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment.1.normal.js @@ -10,15 +10,15 @@ var EE = /*#__PURE__*/ function() { return EE; }(); var npmlog = module.exports = new EE(); -npmlog.on("hi") // both references should see EE.on +npmlog.on('hi') // both references should see EE.on ; -module.exports.on("hi") // here too +module.exports.on('hi') // here too ; npmlog.x = 1; module.exports.y = 2; npmlog.y; module.exports.x; //// [use.js] -var npmlog = require("./npmlog"); +var npmlog = require('./npmlog'); npmlog.x; npmlog.on; diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAssignment.2.minified.js index 976df72c747d..d9e9c7b81fb4 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment.2.minified.js @@ -6,7 +6,7 @@ var EE = function() { } return EE.prototype.on = function(s) {}, EE; }(), npmlog = module.exports = new EE(); -npmlog.on("hi"), module.exports.on("hi"), npmlog.x = 1, module.exports.y = 2, npmlog.y, module.exports.x; +npmlog.on('hi'), module.exports.on('hi'), npmlog.x = 1, module.exports.y = 2, npmlog.y, module.exports.x; //// [use.js] -var npmlog = require("./npmlog"); +var npmlog = require('./npmlog'); npmlog.x, npmlog.on; diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment3.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAssignment3.1.normal.js index c42a101360e5..7a465ad6b40e 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment3.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment3.1.normal.js @@ -3,6 +3,6 @@ module.exports = function x() {}; module.exports() // should be callable ; //// [npm.js] -var mod = require("./mod"); +var mod = require('./mod'); mod() // should be callable from here too ; diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment3.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAssignment3.2.minified.js index 43f0bbf3f349..570122303b80 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment3.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment3.2.minified.js @@ -1,4 +1,4 @@ //// [mod.js] module.exports = function() {}, module.exports(); //// [npm.js] -require("./mod")(); +require('./mod')(); diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment4.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAssignment4.1.normal.js index 80c3d6d0c35a..7dbdc2e9ec5e 100644 --- a/crates/swc/tests/tsc-references/moduleExportAssignment4.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportAssignment4.1.normal.js @@ -3,4 +3,4 @@ exports.default = { m: 1, a: 1 }; -module.exports = exports["default"]; +module.exports = exports['default']; diff --git a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias.1.normal.js b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias.1.normal.js index cd78793410c6..d677a6a7450f 100644 --- a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias.1.normal.js @@ -5,5 +5,5 @@ exports.apply(); exports.apply = a; exports.apply(); //// [test.js] -var apply = require("./moduleExportAliasDuplicateAlias").apply; +var apply = require('./moduleExportAliasDuplicateAlias').apply; apply(); diff --git a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias.2.minified.js b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias.2.minified.js index 3510b81b9f65..a1138914fb31 100644 --- a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias.2.minified.js @@ -1,4 +1,4 @@ //// [moduleExportAliasDuplicateAlias.js] exports.apply = void 0, exports.apply(), exports.apply = function() {}, exports.apply(); //// [test.js] -(0, require("./moduleExportAliasDuplicateAlias").apply)(); +(0, require('./moduleExportAliasDuplicateAlias').apply)(); diff --git a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias2.1.normal.js b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias2.1.normal.js index a31bdfaeaedb..b3bb176ee61d 100644 --- a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias2.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias2.1.normal.js @@ -5,5 +5,5 @@ module.exports.apply = a; module.exports.apply = a; module.exports.apply(); //// [test.js] -var apply = require("./moduleExportAliasDuplicateAlias").apply; +var apply = require('./moduleExportAliasDuplicateAlias').apply; apply(); diff --git a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias2.2.minified.js b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias2.2.minified.js index 22851d04a49b..efff86e77e71 100644 --- a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias2.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias2.2.minified.js @@ -2,4 +2,4 @@ function a() {} module.exports.apply = void 0, module.exports.apply = a, module.exports.apply = a, module.exports.apply(); //// [test.js] -(0, require("./moduleExportAliasDuplicateAlias").apply)(); +(0, require('./moduleExportAliasDuplicateAlias').apply)(); diff --git a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias3.1.normal.js b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias3.1.normal.js index ce381bdc9271..f4e4fbb86bab 100644 --- a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias3.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias3.1.normal.js @@ -4,9 +4,9 @@ exports.apply = undefined; function a() {} exports.apply = a; exports.apply(); -exports.apply = "ok"; +exports.apply = 'ok'; var OK = exports.apply.toUpperCase(); exports.apply = 1; //// [test.js] -var apply = require("./moduleExportAliasDuplicateAlias").apply; +var apply = require('./moduleExportAliasDuplicateAlias').apply; var result = apply.toFixed(); diff --git a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias3.2.minified.js b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias3.2.minified.js index 71cdc0377808..51742a09912d 100644 --- a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias3.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias3.2.minified.js @@ -1,4 +1,4 @@ //// [moduleExportAliasDuplicateAlias.js] -exports.apply = void 0, exports.apply = void 0, exports.apply = function() {}, exports.apply(), exports.apply = "ok", exports.apply.toUpperCase(), exports.apply = 1; +exports.apply = void 0, exports.apply = void 0, exports.apply = function() {}, exports.apply(), exports.apply = 'ok', exports.apply.toUpperCase(), exports.apply = 1; //// [test.js] -require("./moduleExportAliasDuplicateAlias").apply.toFixed(); +require('./moduleExportAliasDuplicateAlias').apply.toFixed(); diff --git a/crates/swc/tests/tsc-references/moduleExportNestedNamespaces.1.normal.js b/crates/swc/tests/tsc-references/moduleExportNestedNamespaces.1.normal.js index ed9ec4cbb9be..6bde8f59d731 100644 --- a/crates/swc/tests/tsc-references/moduleExportNestedNamespaces.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportNestedNamespaces.1.normal.js @@ -10,7 +10,7 @@ module.exports.Classic = function _class() { this.p = 1; }; //// [use.js] -import * as s from "./mod"; +import * as s from './mod'; var k = new s.n.K(); k.x; var classic = new s.Classic(); diff --git a/crates/swc/tests/tsc-references/moduleExportNestedNamespaces.2.minified.js b/crates/swc/tests/tsc-references/moduleExportNestedNamespaces.2.minified.js index 099d1a033691..ad048f419874 100644 --- a/crates/swc/tests/tsc-references/moduleExportNestedNamespaces.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportNestedNamespaces.2.minified.js @@ -6,5 +6,5 @@ module.exports.n = {}, module.exports.n.K = function() { _class_call_check(this, _class), this.p = 1; }; //// [use.js] -import * as s from "./mod"; +import * as s from './mod'; new s.n.K().x, new s.Classic(); diff --git a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment.1.normal.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment.1.normal.js index d2c89b99de9b..45678d1e73ba 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment.1.normal.js @@ -5,7 +5,7 @@ module.exports = function() {}; /** @param {number} a */ module.exports.f = function(a) {}; //// [a.js] /// -var mod1 = require("./mod1"); +var mod1 = require('./mod1'); mod1(); mod1.f() // error, not enough arguments ; diff --git a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment.2.minified.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment.2.minified.js index 97673a9bf55e..bd3e02a23645 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment.2.minified.js @@ -2,5 +2,5 @@ //// [mod1.js] module.exports = function() {}, module.exports.f = function(a) {}; //// [a.js] -var mod1 = require("./mod1"); +var mod1 = require('./mod1'); mod1(), mod1.f(); diff --git a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2.1.normal.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2.1.normal.js index 3964e26d653f..dfc76e78141c 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2.1.normal.js @@ -5,7 +5,7 @@ module.exports = 1; module.exports.f = function() {}; //// [a.js] /// -var mod1 = require("./mod1"); +var mod1 = require('./mod1'); mod1.toFixed(12); mod1.f() // error, 'f' is not a property on 'number' ; diff --git a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2.2.minified.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2.2.minified.js index 5aed0b4963e9..510eac54dfa5 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment2.2.minified.js @@ -2,5 +2,5 @@ //// [mod1.js] module.exports = 1, module.exports.f = function() {}; //// [a.js] -var mod1 = require("./mod1"); +var mod1 = require('./mod1'); mod1.toFixed(12), mod1.f(); diff --git a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment3.1.normal.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment3.1.normal.js index af999d777325..1b95b1a269d2 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment3.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment3.1.normal.js @@ -1,17 +1,17 @@ //// [requires.d.ts] //// [mod1.js] /// -module.exports.bothBefore = "string"; +module.exports.bothBefore = 'string'; module.exports = { justExport: 1, bothBefore: 2, bothAfter: 3 }; -module.exports.bothAfter = "string"; -module.exports.justProperty = "string"; +module.exports.bothAfter = 'string'; +module.exports.justProperty = 'string'; //// [a.js] /// -var mod1 = require("./mod1"); +var mod1 = require('./mod1'); mod1.justExport.toFixed(); mod1.bothBefore.toFixed() // error, 'toFixed' not on 'string | number' ; diff --git a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment3.2.minified.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment3.2.minified.js index 4a1d324d5f59..fd1749be8711 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment3.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment3.2.minified.js @@ -1,10 +1,10 @@ //// [requires.d.ts] //// [mod1.js] -module.exports.bothBefore = "string", module.exports = { +module.exports.bothBefore = 'string', module.exports = { justExport: 1, bothBefore: 2, bothAfter: 3 -}, module.exports.bothAfter = "string", module.exports.justProperty = "string"; +}, module.exports.bothAfter = 'string', module.exports.justProperty = 'string'; //// [a.js] -var mod1 = require("./mod1"); +var mod1 = require('./mod1'); mod1.justExport.toFixed(), mod1.bothBefore.toFixed(), mod1.bothAfter.toFixed(), mod1.justProperty.length; diff --git a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment4.1.normal.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment4.1.normal.js index b3d581811438..b75a35d9cb37 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment4.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment4.1.normal.js @@ -1,7 +1,7 @@ //// [requires.d.ts] //// [mod1.js] /// -module.exports.bothBefore = "string"; +module.exports.bothBefore = 'string'; A.justExport = 4; A.bothBefore = 2; A.bothAfter = 3; @@ -9,11 +9,11 @@ module.exports = A; function A() { this.p = 1; } -module.exports.bothAfter = "string"; -module.exports.justProperty = "string"; +module.exports.bothAfter = 'string'; +module.exports.justProperty = 'string'; //// [a.js] /// -var mod1 = require("./mod1"); +var mod1 = require('./mod1'); mod1.justExport.toFixed(); mod1.bothBefore.toFixed() // error ; diff --git a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment4.2.minified.js b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment4.2.minified.js index ac0bb0d12d8d..576727e56abb 100644 --- a/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment4.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleExportWithExportPropertyAssignment4.2.minified.js @@ -3,7 +3,7 @@ function A() { this.p = 1; } -module.exports.bothBefore = "string", A.justExport = 4, A.bothBefore = 2, A.bothAfter = 3, module.exports = A, module.exports.bothAfter = "string", module.exports.justProperty = "string"; +module.exports.bothBefore = 'string', A.justExport = 4, A.bothBefore = 2, A.bothAfter = 3, module.exports = A, module.exports.bothAfter = 'string', module.exports.justProperty = 'string'; //// [a.js] -var mod1 = require("./mod1"); +var mod1 = require('./mod1'); mod1.justExport.toFixed(), mod1.bothBefore.toFixed(), mod1.bothAfter.toFixed(), mod1.justProperty.length; diff --git a/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.1.normal.js b/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.1.normal.js index 96b72da3cc30..da0bdef1f4d1 100644 --- a/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.1.normal.js +++ b/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.1.normal.js @@ -50,10 +50,10 @@ var A; } var array = null; var fn = function(s) { - return "hello " + s; + return 'hello ' + s; }; var ol = { - s: "hello", + s: 'hello', id: 2, isvalid: true }; @@ -111,10 +111,10 @@ var Y; Y.F = F; Y.array = null; Y.fn = function(s) { - return "hello " + s; + return 'hello ' + s; }; Y.ol = { - s: "hello", + s: 'hello', id: 2, isvalid: true }; diff --git a/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.2.minified.js b/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.2.minified.js index adf7ad67e3f9..fd261e41f491 100644 --- a/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.2.minified.js @@ -24,9 +24,9 @@ A || (A = {}), Module || (Module = {}), (Color1 = Color || (Color = {}))[Color1. }(A1), Y1.BB = BB, Y1.Module || (Y1.Module = {}), (Color2 = Y1.Color || (Y1.Color = {}))[Color2.Blue = 0] = "Blue", Color2[Color2.Red = 1] = "Red", Y1.x = 12, Y1.F = function(s) { return 2; }, Y1.array = null, Y1.fn = function(s) { - return "hello " + s; + return 'hello ' + s; }, Y1.ol = { - s: "hello", + s: 'hello', id: 2, isvalid: !0 }; diff --git a/crates/swc/tests/tsc-references/multipleDeclarations.1.normal.js b/crates/swc/tests/tsc-references/multipleDeclarations.1.normal.js index c9f2c18e1edd..502021a5f34a 100644 --- a/crates/swc/tests/tsc-references/multipleDeclarations.1.normal.js +++ b/crates/swc/tests/tsc-references/multipleDeclarations.1.normal.js @@ -11,7 +11,7 @@ var X = /*#__PURE__*/ function() { function X() { _class_call_check(this, X); this.m = this.m.bind(this); - this.mistake = "frankly, complete nonsense"; + this.mistake = 'frankly, complete nonsense'; } var _proto = X.prototype; _proto.m = function m() {}; @@ -27,7 +27,7 @@ var Y = /*#__PURE__*/ function() { function Y() { _class_call_check(this, Y); this.m = this.m.bind(this); - this.mistake = "even more nonsense"; + this.mistake = 'even more nonsense'; } var _proto = Y.prototype; _proto.mistake = function mistake() {}; diff --git a/crates/swc/tests/tsc-references/multipleDeclarations.2.minified.js b/crates/swc/tests/tsc-references/multipleDeclarations.2.minified.js index 7b7ddb6243eb..5115d104d14e 100644 --- a/crates/swc/tests/tsc-references/multipleDeclarations.2.minified.js +++ b/crates/swc/tests/tsc-references/multipleDeclarations.2.minified.js @@ -7,7 +7,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; }; var X = function() { function X() { - _class_call_check(this, X), this.m = this.m.bind(this), this.mistake = "frankly, complete nonsense"; + _class_call_check(this, X), this.m = this.m.bind(this), this.mistake = 'frankly, complete nonsense'; } var _proto = X.prototype; return _proto.m = function() {}, _proto.mistake = function() {}, X; @@ -15,7 +15,7 @@ var X = function() { X.prototype.mistake = !1, x.m(), x.mistake; var Y = function() { function Y() { - _class_call_check(this, Y), this.m = this.m.bind(this), this.mistake = "even more nonsense"; + _class_call_check(this, Y), this.m = this.m.bind(this), this.mistake = 'even more nonsense'; } var _proto = Y.prototype; return _proto.mistake = function() {}, _proto.m = function() {}, Y; diff --git a/crates/swc/tests/tsc-references/multipleNumericIndexers.1.normal.js b/crates/swc/tests/tsc-references/multipleNumericIndexers.1.normal.js index b8aacc00d438..5dadb2697ce3 100644 --- a/crates/swc/tests/tsc-references/multipleNumericIndexers.1.normal.js +++ b/crates/swc/tests/tsc-references/multipleNumericIndexers.1.normal.js @@ -7,8 +7,8 @@ var C = function C() { }; var a; var b = { - 1: "", - "2": "" + 1: '', + "2": '' }; var C2 = function C2() { "use strict"; diff --git a/crates/swc/tests/tsc-references/multipleStringIndexers.1.normal.js b/crates/swc/tests/tsc-references/multipleStringIndexers.1.normal.js index c896a2ac90af..751b60c3d289 100644 --- a/crates/swc/tests/tsc-references/multipleStringIndexers.1.normal.js +++ b/crates/swc/tests/tsc-references/multipleStringIndexers.1.normal.js @@ -7,7 +7,7 @@ var C = function C() { }; var a; var b = { - y: "" + y: '' }; var C2 = function C2() { "use strict"; diff --git a/crates/swc/tests/tsc-references/nameCollision.1.normal.js b/crates/swc/tests/tsc-references/nameCollision.1.normal.js index 82f05cc8d729..86ba8834e43e 100644 --- a/crates/swc/tests/tsc-references/nameCollision.1.normal.js +++ b/crates/swc/tests/tsc-references/nameCollision.1.normal.js @@ -5,7 +5,7 @@ var A; // these 2 statements force an underscore before the 'A' // in the generated function call. var A1 = 12; - var _A = ""; + var _A = ''; })(A || (A = {})); var B; (function(B) { @@ -47,5 +47,5 @@ var D; // no collision, since interface doesn't // generate code. (function(D) { - D.E = "hello"; + D.E = 'hello'; })(D || (D = {})); diff --git a/crates/swc/tests/tsc-references/nameCollision.2.minified.js b/crates/swc/tests/tsc-references/nameCollision.2.minified.js index 855d84693665..68db21fccdea 100644 --- a/crates/swc/tests/tsc-references/nameCollision.2.minified.js +++ b/crates/swc/tests/tsc-references/nameCollision.2.minified.js @@ -1,4 +1,4 @@ //// [nameCollision.ts] var A, B, X, Y, D, X1, Y1, Y2, Y3, Y4; import "@swc/helpers/_/_class_call_check"; -A || (A = {}), B || (B = {}), B || (B = {}), (Y1 = (X1 = X || (X = {})).Y || (X1.Y = {})).Z || (Y1.Z = {}), (Y4 = Y3 = (Y3 = (Y2 = Y || (Y = {})).Y || (Y2.Y = {})).Y || (Y3.Y = {}))[Y4.Red = 0] = "Red", Y4[Y4.Blue = 1] = "Blue", (D || (D = {})).E = "hello"; +A || (A = {}), B || (B = {}), B || (B = {}), (Y1 = (X1 = X || (X = {})).Y || (X1.Y = {})).Z || (Y1.Z = {}), (Y4 = Y3 = (Y3 = (Y2 = Y || (Y = {})).Y || (Y2.Y = {})).Y || (Y3.Y = {}))[Y4.Red = 0] = "Red", Y4[Y4.Blue = 1] = "Blue", (D || (D = {})).E = 'hello'; diff --git a/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias.1.normal.js b/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias.1.normal.js index 28702e90561f..0a31eab2760e 100644 --- a/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias.1.normal.js +++ b/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias.1.normal.js @@ -1,6 +1,6 @@ //// [node_modules/untyped/index.js] module.exports = {}; //// [bug40140.js] -var u = require("untyped"); +var u = require('untyped'); u.assignment.nested = true; u.noError(); diff --git a/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias.2.minified.js b/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias.2.minified.js index 717ac6a78784..b8b6830bc932 100644 --- a/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias.2.minified.js +++ b/crates/swc/tests/tsc-references/namespaceAssignmentToRequireAlias.2.minified.js @@ -1,5 +1,5 @@ //// [node_modules/untyped/index.js] module.exports = {}; //// [bug40140.js] -var u = require("untyped"); +var u = require('untyped'); u.assignment.nested = !0, u.noError(); diff --git a/crates/swc/tests/tsc-references/namespaceMemberAccess.1.normal.js b/crates/swc/tests/tsc-references/namespaceMemberAccess.1.normal.js index 71bb8cacac69..17c91517b312 100644 --- a/crates/swc/tests/tsc-references/namespaceMemberAccess.1.normal.js +++ b/crates/swc/tests/tsc-references/namespaceMemberAccess.1.normal.js @@ -6,6 +6,6 @@ var A = function A() { }; export { }; //// [/b.ts] -import * as types from "./a"; +import * as types from './a'; types.A; var A = types.A; diff --git a/crates/swc/tests/tsc-references/namespaceMemberAccess.2.minified.js b/crates/swc/tests/tsc-references/namespaceMemberAccess.2.minified.js index bb2e1faacb73..a72c2f198864 100644 --- a/crates/swc/tests/tsc-references/namespaceMemberAccess.2.minified.js +++ b/crates/swc/tests/tsc-references/namespaceMemberAccess.2.minified.js @@ -1,5 +1,5 @@ //// [/a.ts] import "@swc/helpers/_/_class_call_check"; //// [/b.ts] -import * as types from "./a"; +import * as types from './a'; types.A, types.A; diff --git a/crates/swc/tests/tsc-references/nestedDestructuringOfRequire.1.normal.js b/crates/swc/tests/tsc-references/nestedDestructuringOfRequire.1.normal.js index 405808a076dc..2fadebc92aa3 100644 --- a/crates/swc/tests/tsc-references/nestedDestructuringOfRequire.1.normal.js +++ b/crates/swc/tests/tsc-references/nestedDestructuringOfRequire.1.normal.js @@ -5,6 +5,6 @@ var chalk = { }; module.exports.chalk = chalk; //// [main.js] -var _require = require("./mod1"), grey = _require.chalk.grey; +var _require = require('./mod1'), grey = _require.chalk.grey; grey; chalk; diff --git a/crates/swc/tests/tsc-references/nestedDestructuringOfRequire.2.minified.js b/crates/swc/tests/tsc-references/nestedDestructuringOfRequire.2.minified.js index c72a71381506..3ab8c1dcd97c 100644 --- a/crates/swc/tests/tsc-references/nestedDestructuringOfRequire.2.minified.js +++ b/crates/swc/tests/tsc-references/nestedDestructuringOfRequire.2.minified.js @@ -4,4 +4,4 @@ module.exports.chalk = { grey: {} }; //// [main.js] -require("./mod1").chalk.grey, chalk; +require('./mod1').chalk.grey, chalk; diff --git a/crates/swc/tests/tsc-references/neverReturningFunctions1.1.normal.js b/crates/swc/tests/tsc-references/neverReturningFunctions1.1.normal.js index 8f2473bef809..154aa48c8601 100644 --- a/crates/swc/tests/tsc-references/neverReturningFunctions1.1.normal.js +++ b/crates/swc/tests/tsc-references/neverReturningFunctions1.1.normal.js @@ -150,7 +150,7 @@ function f43() { f[0](); // No effect (not a dotted name) f; } -var Component = registerComponent("test-component", { +var Component = registerComponent('test-component', { schema: { myProperty: { default: [], @@ -161,13 +161,13 @@ var Component = registerComponent("test-component", { } }, string: { - type: "string" + type: 'string' }, num: 0 }, init: function init() { this.data.num = 0; - this.el.setAttribute("custom-attribute", "custom-value"); + this.el.setAttribute('custom-attribute', 'custom-value'); }, update: function update() {}, tick: function tick() {}, diff --git a/crates/swc/tests/tsc-references/neverReturningFunctions1.2.minified.js b/crates/swc/tests/tsc-references/neverReturningFunctions1.2.minified.js index 7882902e863d..ce58996b16f3 100644 --- a/crates/swc/tests/tsc-references/neverReturningFunctions1.2.minified.js +++ b/crates/swc/tests/tsc-references/neverReturningFunctions1.2.minified.js @@ -4,7 +4,7 @@ import { _ as _get } from "@swc/helpers/_/_get"; import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -registerComponent("test-component", { +registerComponent('test-component', { schema: { myProperty: { default: [], @@ -15,12 +15,12 @@ registerComponent("test-component", { } }, string: { - type: "string" + type: 'string' }, num: 0 }, init: function() { - this.data.num = 0, this.el.setAttribute("custom-attribute", "custom-value"); + this.data.num = 0, this.el.setAttribute('custom-attribute', 'custom-value'); }, update: function() {}, tick: function() {}, diff --git a/crates/swc/tests/tsc-references/noInfer.1.normal.js b/crates/swc/tests/tsc-references/noInfer.1.normal.js index caf53942bf9f..1d1c3aebe84e 100644 --- a/crates/swc/tests/tsc-references/noInfer.1.normal.js +++ b/crates/swc/tests/tsc-references/noInfer.1.normal.js @@ -2,24 +2,24 @@ // NoInfer is erased for primitives import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _create_class } from "@swc/helpers/_/_create_class"; -foo1("foo", "foo") // ok +foo1('foo', 'foo') // ok ; -foo1("foo", "bar") // error +foo1('foo', 'bar') // error ; -foo2("foo", [ - "bar" +foo2('foo', [ + 'bar' ]) // error ; -foo3("foo", [ - "bar" +foo3('foo', [ + 'bar' ]) // error ; -foo4("foo", { - x: "bar" +foo4('foo', { + x: 'bar' }) // error ; -foo5("foo", { - x: "bar" +foo5('foo', { + x: 'bar' }) // error ; doSomething(new Animal(), function() { diff --git a/crates/swc/tests/tsc-references/noInfer.2.minified.js b/crates/swc/tests/tsc-references/noInfer.2.minified.js index 02c2deda48f4..e79e7dcb5fc0 100644 --- a/crates/swc/tests/tsc-references/noInfer.2.minified.js +++ b/crates/swc/tests/tsc-references/noInfer.2.minified.js @@ -1,14 +1,14 @@ //// [noInfer.ts] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _create_class } from "@swc/helpers/_/_create_class"; -foo1("foo", "foo"), foo1("foo", "bar"), foo2("foo", [ - "bar" -]), foo3("foo", [ - "bar" -]), foo4("foo", { - x: "bar" -}), foo5("foo", { - x: "bar" +foo1('foo', 'foo'), foo1('foo', 'bar'), foo2('foo', [ + 'bar' +]), foo3('foo', [ + 'bar' +]), foo4('foo', { + x: 'bar' +}), foo5('foo', { + x: 'bar' }), doSomething(new Animal(), function() { return new Animal(); }), doSomething(new Animal(), function() { diff --git a/crates/swc/tests/tsc-references/nonPrimitiveNarrow.1.normal.js b/crates/swc/tests/tsc-references/nonPrimitiveNarrow.1.normal.js index faef907de93a..8dd36db26c95 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveNarrow.1.normal.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveNarrow.1.normal.js @@ -10,11 +10,11 @@ if (_instanceof(a, Narrow)) { a.narrowed; // ok a = 123; // error } -if (typeof a === "number") { +if (typeof a === 'number') { a.toFixed(); // error, never } var b; -if (typeof b === "object") { +if (typeof b === 'object') { b.toString(); // ok, object | null } else { b.toString(); // error, never diff --git a/crates/swc/tests/tsc-references/nonPrimitiveNarrow.2.minified.js b/crates/swc/tests/tsc-references/nonPrimitiveNarrow.2.minified.js index 9334c5d4f8ff..066cf6cf9c9d 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveNarrow.2.minified.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveNarrow.2.minified.js @@ -4,4 +4,4 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; _instanceof(a, function Narrow() { _class_call_check(this, Narrow); -}) && (a.narrowed, a = 123), "number" == typeof a && a.toFixed(), b.toString(); +}) && (a.narrowed, a = 123), 'number' == typeof a && a.toFixed(), b.toString(); diff --git a/crates/swc/tests/tsc-references/nonPrimitiveUnionIntersection.1.normal.js b/crates/swc/tests/tsc-references/nonPrimitiveUnionIntersection.1.normal.js index 75a61bd4bfb9..d96f8d09b03e 100644 --- a/crates/swc/tests/tsc-references/nonPrimitiveUnionIntersection.1.normal.js +++ b/crates/swc/tests/tsc-references/nonPrimitiveUnionIntersection.1.normal.js @@ -5,8 +5,8 @@ var c = 123; // error a = b; // error b = a; // ok var foo = { - bar: "bar" + bar: 'bar' }; // ok var bar = { - bar: "bar" + bar: 'bar' }; // error diff --git a/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined.1.normal.js b/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined.1.normal.js index add6a3030ee4..e0da3ce16be3 100644 --- a/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined.1.normal.js +++ b/crates/swc/tests/tsc-references/nullIsSubtypeOfEverythingButUndefined.1.normal.js @@ -8,8 +8,8 @@ var r0b = true ? u : null; var r0b = true ? null : u; var r1 = true ? 1 : null; var r1 = true ? null : 1; -var r2 = true ? "" : null; -var r2 = true ? null : ""; +var r2 = true ? '' : null; +var r2 = true ? null : ''; var r3 = true ? true : null; var r3 = true ? null : true; var r4 = true ? new Date() : null; diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator1.1.normal.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator1.1.normal.js index 3a0ff9b46de6..aacb592b3804 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperator1.1.normal.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator1.1.normal.js @@ -1,8 +1,8 @@ //// [nullishCoalescingOperator1.ts] -var aa1 = a1 !== null && a1 !== void 0 ? a1 : "whatever"; -var aa2 = a2 !== null && a2 !== void 0 ? a2 : "whatever"; -var aa3 = a3 !== null && a3 !== void 0 ? a3 : "whatever"; -var aa4 = a4 !== null && a4 !== void 0 ? a4 : "whatever"; +var aa1 = a1 !== null && a1 !== void 0 ? a1 : 'whatever'; +var aa2 = a2 !== null && a2 !== void 0 ? a2 : 'whatever'; +var aa3 = a3 !== null && a3 !== void 0 ? a3 : 'whatever'; +var aa4 = a4 !== null && a4 !== void 0 ? a4 : 'whatever'; var bb1 = b1 !== null && b1 !== void 0 ? b1 : 1; var bb2 = b2 !== null && b2 !== void 0 ? b2 : 1; var bb3 = b3 !== null && b3 !== void 0 ? b3 : 1; diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator10.1.normal.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator10.1.normal.js index 86c4be2bec9b..2c30a24239f1 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperator10.1.normal.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator10.1.normal.js @@ -1,3 +1,3 @@ //// [nullishCoalescingOperator10.ts] var _f; -var gg = (_f = f()) !== null && _f !== void 0 ? _f : "foo"; +var gg = (_f = f()) !== null && _f !== void 0 ? _f : 'foo'; diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator2.1.normal.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator2.1.normal.js index 60d5633d3fb9..cc1bc0fd333b 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperator2.1.normal.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator2.1.normal.js @@ -1,10 +1,10 @@ //// [nullishCoalescingOperator2.ts] -var aa1 = a1 !== null && a1 !== void 0 ? a1 : "whatever"; -var aa2 = a2 !== null && a2 !== void 0 ? a2 : "whatever"; -var aa3 = a3 !== null && a3 !== void 0 ? a3 : "whatever"; -var aa4 = a4 !== null && a4 !== void 0 ? a4 : "whatever"; -var aa5 = a5 !== null && a5 !== void 0 ? a5 : "whatever"; -var aa6 = a6 !== null && a6 !== void 0 ? a6 : "whatever"; -var aa7 = a7 !== null && a7 !== void 0 ? a7 : "whatever"; -var aa8 = a8 !== null && a8 !== void 0 ? a8 : "whatever"; -var aa9 = a9 !== null && a9 !== void 0 ? a9 : "whatever"; +var aa1 = a1 !== null && a1 !== void 0 ? a1 : 'whatever'; +var aa2 = a2 !== null && a2 !== void 0 ? a2 : 'whatever'; +var aa3 = a3 !== null && a3 !== void 0 ? a3 : 'whatever'; +var aa4 = a4 !== null && a4 !== void 0 ? a4 : 'whatever'; +var aa5 = a5 !== null && a5 !== void 0 ? a5 : 'whatever'; +var aa6 = a6 !== null && a6 !== void 0 ? a6 : 'whatever'; +var aa7 = a7 !== null && a7 !== void 0 ? a7 : 'whatever'; +var aa8 = a8 !== null && a8 !== void 0 ? a8 : 'whatever'; +var aa9 = a9 !== null && a9 !== void 0 ? a9 : 'whatever'; diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator3.1.normal.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator3.1.normal.js index edc5aa11e4bd..c020f4913f1a 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperator3.1.normal.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator3.1.normal.js @@ -1,3 +1,3 @@ //// [nullishCoalescingOperator3.ts] var _ref, _ref1, _ref2, _ref3, _ref4; -var aa1 = (_ref4 = (_ref3 = (_ref2 = (_ref1 = (_ref = a1 !== null && a1 !== void 0 ? a1 : a2) !== null && _ref !== void 0 ? _ref : a3) !== null && _ref1 !== void 0 ? _ref1 : a4) !== null && _ref2 !== void 0 ? _ref2 : a5) !== null && _ref3 !== void 0 ? _ref3 : a6) !== null && _ref4 !== void 0 ? _ref4 : "whatever"; +var aa1 = (_ref4 = (_ref3 = (_ref2 = (_ref1 = (_ref = a1 !== null && a1 !== void 0 ? a1 : a2) !== null && _ref !== void 0 ? _ref : a3) !== null && _ref1 !== void 0 ? _ref1 : a4) !== null && _ref2 !== void 0 ? _ref2 : a5) !== null && _ref3 !== void 0 ? _ref3 : a6) !== null && _ref4 !== void 0 ? _ref4 : 'whatever'; diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator7.1.normal.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator7.1.normal.js index a9eb04d6da36..f927a1ca98f4 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperator7.1.normal.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator7.1.normal.js @@ -1,7 +1,7 @@ //// [nullishCoalescingOperator7.ts] var foo1 = a ? 1 : 2; -var foo2 = (a !== null && a !== void 0 ? a : "foo") ? 1 : 2; -var foo3 = (a !== null && a !== void 0 ? a : "foo") ? b !== null && b !== void 0 ? b : "bar" : c !== null && c !== void 0 ? c : "baz"; +var foo2 = (a !== null && a !== void 0 ? a : 'foo') ? 1 : 2; +var foo3 = (a !== null && a !== void 0 ? a : 'foo') ? b !== null && b !== void 0 ? b : 'bar' : c !== null && c !== void 0 ? c : 'baz'; function f() { - var foo4 = (a !== null && a !== void 0 ? a : "foo") ? b !== null && b !== void 0 ? b : "bar" : c !== null && c !== void 0 ? c : "baz"; + var foo4 = (a !== null && a !== void 0 ? a : 'foo') ? b !== null && b !== void 0 ? b : 'bar' : c !== null && c !== void 0 ? c : 'baz'; } diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator7.2.minified.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator7.2.minified.js index 7fb029b43f2f..c3f0add06b78 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperator7.2.minified.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator7.2.minified.js @@ -1,2 +1,2 @@ //// [nullishCoalescingOperator7.ts] -a, null != a && a, (null != a ? a : "foo") ? null != b && b : null != c && c; +a, null != a && a, (null != a ? a : 'foo') ? null != b && b : null != c && c; diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator_not_strict.1.normal.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator_not_strict.1.normal.js index cc5e36decbfa..ba128fa83b41 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperator_not_strict.1.normal.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator_not_strict.1.normal.js @@ -1,10 +1,10 @@ //// [nullishCoalescingOperator_not_strict.ts] -var aa1 = a1 !== null && a1 !== void 0 ? a1 : "whatever"; -var aa2 = a2 !== null && a2 !== void 0 ? a2 : "whatever"; -var aa3 = a3 !== null && a3 !== void 0 ? a3 : "whatever"; -var aa4 = a4 !== null && a4 !== void 0 ? a4 : "whatever"; -var aa5 = a5 !== null && a5 !== void 0 ? a5 : "whatever"; -var aa6 = a6 !== null && a6 !== void 0 ? a6 : "whatever"; -var aa7 = a7 !== null && a7 !== void 0 ? a7 : "whatever"; -var aa8 = a8 !== null && a8 !== void 0 ? a8 : "whatever"; -var aa9 = a9 !== null && a9 !== void 0 ? a9 : "whatever"; +var aa1 = a1 !== null && a1 !== void 0 ? a1 : 'whatever'; +var aa2 = a2 !== null && a2 !== void 0 ? a2 : 'whatever'; +var aa3 = a3 !== null && a3 !== void 0 ? a3 : 'whatever'; +var aa4 = a4 !== null && a4 !== void 0 ? a4 : 'whatever'; +var aa5 = a5 !== null && a5 !== void 0 ? a5 : 'whatever'; +var aa6 = a6 !== null && a6 !== void 0 ? a6 : 'whatever'; +var aa7 = a7 !== null && a7 !== void 0 ? a7 : 'whatever'; +var aa8 = a8 !== null && a8 !== void 0 ? a8 : 'whatever'; +var aa9 = a9 !== null && a9 !== void 0 ? a9 : 'whatever'; diff --git a/crates/swc/tests/tsc-references/numberPropertyAccess.1.normal.js b/crates/swc/tests/tsc-references/numberPropertyAccess.1.normal.js index 1c124f35b582..868ce96d4f98 100644 --- a/crates/swc/tests/tsc-references/numberPropertyAccess.1.normal.js +++ b/crates/swc/tests/tsc-references/numberPropertyAccess.1.normal.js @@ -1,6 +1,6 @@ //// [numberPropertyAccess.ts] var x = 1; var a = x.toExponential(); -var b = x.hasOwnProperty("toFixed"); -var c = x["toExponential"](); -var d = x["hasOwnProperty"]("toFixed"); +var b = x.hasOwnProperty('toFixed'); +var c = x['toExponential'](); +var d = x['hasOwnProperty']('toFixed'); diff --git a/crates/swc/tests/tsc-references/numberPropertyAccess.2.minified.js b/crates/swc/tests/tsc-references/numberPropertyAccess.2.minified.js index b38a4bc3c537..f8f0aac84630 100644 --- a/crates/swc/tests/tsc-references/numberPropertyAccess.2.minified.js +++ b/crates/swc/tests/tsc-references/numberPropertyAccess.2.minified.js @@ -1,2 +1,2 @@ //// [numberPropertyAccess.ts] -1..hasOwnProperty("toFixed"), 1..hasOwnProperty("toFixed"); +1..hasOwnProperty('toFixed'), 1..hasOwnProperty('toFixed'); diff --git a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations.1.normal.js b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations.1.normal.js index bf9f91d4f9a8..7170a5287af1 100644 --- a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations.1.normal.js +++ b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations.1.normal.js @@ -9,7 +9,7 @@ var C = /*#__PURE__*/ function() { } var _proto = C.prototype; _proto.foo = function foo() { - return ""; + return ''; }; C.foo = function foo() {} // ok ; @@ -17,7 +17,7 @@ var C = /*#__PURE__*/ function() { { key: "X", get: function get() { - return ""; + return ''; }, set: function set(v1) {} // ok } @@ -34,21 +34,21 @@ var C = /*#__PURE__*/ function() { var a; // error var b = { - a: "", + a: '', b: 1, c: function() {}, - "d": "", + "d": '', "e": 1, - 1.0: "", + 1.0: '', 2.0: 1, - "3.0": "", + "3.0": '', "4.0": 1, f: null, get X () { - return ""; + return ''; }, set X (v){}, foo: function foo() { - return ""; + return ''; } }; diff --git a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2.1.normal.js b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2.1.normal.js index 51a5c692fe52..685eca082108 100644 --- a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2.1.normal.js +++ b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2.1.normal.js @@ -10,7 +10,7 @@ var A = /*#__PURE__*/ function() { } var _proto = A.prototype; _proto.foo = function foo() { - return ""; + return ''; }; return A; }(); @@ -24,7 +24,7 @@ var B = /*#__PURE__*/ function(A) { } var _proto = B.prototype; _proto.bar = function bar() { - return ""; + return ''; }; return B; }(A); @@ -39,5 +39,5 @@ var b = { 2.0: new B(), "2.5": new B(), 3.0: 1, - "4.0": "" + "4.0": '' }; diff --git a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2.2.minified.js b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2.2.minified.js index c9daf9044f6a..2eeffa88f296 100644 --- a/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2.2.minified.js +++ b/crates/swc/tests/tsc-references/numericIndexerConstrainsPropertyDeclarations2.2.minified.js @@ -7,7 +7,7 @@ var A = function() { _class_call_check(this, A); } return A.prototype.foo = function() { - return ""; + return ''; }, A; }(), B = function(A) { _inherits(B, A); @@ -16,7 +16,7 @@ var A = function() { return _class_call_check(this, B), _super.apply(this, arguments); } return B.prototype.bar = function() { - return ""; + return ''; }, B; }(A); new A(), new B(), new B(); diff --git a/crates/swc/tests/tsc-references/numericIndexingResults.1.normal.js b/crates/swc/tests/tsc-references/numericIndexingResults.1.normal.js index 21a5b9f0de91..dd65cf65e985 100644 --- a/crates/swc/tests/tsc-references/numericIndexingResults.1.normal.js +++ b/crates/swc/tests/tsc-references/numericIndexingResults.1.normal.js @@ -3,47 +3,47 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var C = function C() { "use strict"; _class_call_check(this, C); - this[1] = ""; - this["2"] = ""; + this[1] = ''; + this["2"] = ''; }; var c; -var r1 = c["1"]; -var r2 = c["2"]; -var r3 = c["3"]; +var r1 = c['1']; +var r2 = c['2']; +var r3 = c['3']; var r4 = c[1]; var r5 = c[2]; var r6 = c[3]; var i; -var r1 = i["1"]; -var r2 = i["2"]; -var r3 = i["3"]; +var r1 = i['1']; +var r2 = i['2']; +var r3 = i['3']; var r4 = i[1]; var r5 = i[2]; var r6 = i[3]; var a; -var r1 = a["1"]; -var r2 = a["2"]; -var r3 = a["3"]; +var r1 = a['1']; +var r2 = a['2']; +var r3 = a['3']; var r4 = a[1]; var r5 = a[2]; var r6 = a[3]; var b = { - 1: "", - "2": "" + 1: '', + "2": '' }; -var r1a = b["1"]; -var r2a = b["2"]; -var r3 = b["3"]; +var r1a = b['1']; +var r2a = b['2']; +var r3 = b['3']; var r4 = b[1]; var r5 = b[2]; var r6 = b[3]; var b2 = { - 1: "", - "2": "" + 1: '', + "2": '' }; -var r1b = b2["1"]; -var r2b = b2["2"]; -var r3 = b2["3"]; +var r1b = b2['1']; +var r2b = b2['2']; +var r3 = b2['3']; var r4 = b2[1]; var r5 = b2[2]; var r6 = b2[3]; diff --git a/crates/swc/tests/tsc-references/numericIndexingResults.2.minified.js b/crates/swc/tests/tsc-references/numericIndexingResults.2.minified.js index 8ecc6a353372..e482bad35706 100644 --- a/crates/swc/tests/tsc-references/numericIndexingResults.2.minified.js +++ b/crates/swc/tests/tsc-references/numericIndexingResults.2.minified.js @@ -1,13 +1,13 @@ //// [numericIndexingResults.ts] import "@swc/helpers/_/_class_call_check"; -c["1"], c["2"], c["3"], c[1], c[2], c[3], i["1"], i["2"], i["3"], i[1], i[2], i[3], a["1"], a["2"], a["3"], a[1], a[2], a[3]; +c['1'], c['2'], c['3'], c[1], c[2], c[3], i['1'], i['2'], i['3'], i[1], i[2], i[3], a['1'], a['2'], a['3'], a[1], a[2], a[3]; var c, i, a, b = { - 1: "", - 2: "" + 1: '', + 2: '' }; -b["1"], b["2"], b["3"], b[1], b[2], b[3]; +b['1'], b['2'], b['3'], b[1], b[2], b[3]; var b2 = { - 1: "", - 2: "" + 1: '', + 2: '' }; -b2["1"], b2["2"], b2["3"], b2[1], b2[2], b2[3]; +b2['1'], b2['2'], b2['3'], b2[1], b2[2], b2[3]; diff --git a/crates/swc/tests/tsc-references/numericStringLiteralTypes.1.normal.js b/crates/swc/tests/tsc-references/numericStringLiteralTypes.1.normal.js index f3f48359f152..60fc14b00aab 100644 --- a/crates/swc/tests/tsc-references/numericStringLiteralTypes.1.normal.js +++ b/crates/swc/tests/tsc-references/numericStringLiteralTypes.1.normal.js @@ -5,7 +5,7 @@ function f1(a, x) { function f2(a, x) { var s = a[x]; // boolean } -var container1 = createContainer("hi"); +var container1 = createContainer('hi'); var container2 = createContainer(2); f([ container1, diff --git a/crates/swc/tests/tsc-references/numericStringLiteralTypes.2.minified.js b/crates/swc/tests/tsc-references/numericStringLiteralTypes.2.minified.js index b110b7f14301..161420d7ca10 100644 --- a/crates/swc/tests/tsc-references/numericStringLiteralTypes.2.minified.js +++ b/crates/swc/tests/tsc-references/numericStringLiteralTypes.2.minified.js @@ -1,5 +1,5 @@ //// [numericStringLiteralTypes.ts] f([ - createContainer("hi"), + createContainer('hi'), createContainer(2) ], function(value1, value2) {}); diff --git a/crates/swc/tests/tsc-references/objectLiteralGettersAndSetters.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralGettersAndSetters.1.normal.js index 186bf77b123a..377b02ca14fd 100644 --- a/crates/swc/tests/tsc-references/objectLiteralGettersAndSetters.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralGettersAndSetters.1.normal.js @@ -1,8 +1,8 @@ //// [objectLiteralGettersAndSetters.ts] // Get and set accessor with the same name var sameName1a = { - get "a" () { - return ""; + get 'a' () { + return ''; }, set a (n){ var p = n; @@ -11,7 +11,7 @@ var sameName1a = { }; var sameName2a = { get 0.0 () { - return ""; + return ''; }, set 0 (n){ var p1 = n; @@ -20,7 +20,7 @@ var sameName2a = { }; var sameName3a = { get 0x20 () { - return ""; + return ''; }, set 3.2e1 (n){ var p2 = n; @@ -28,8 +28,8 @@ var sameName3a = { } }; var sameName4a = { - get "" () { - return ""; + get '' () { + return ''; }, set "" (n){ var p3 = n; @@ -37,17 +37,17 @@ var sameName4a = { } }; var sameName5a = { - get " " () { - return ""; + get '\t' () { + return ''; }, - set " " (n){ + set '\t' (n){ var p4 = n; var p4; } }; var sameName6a = { - get "a" () { - return ""; + get 'a' () { + return ''; }, set a (n){ var p5 = n; @@ -57,19 +57,19 @@ var sameName6a = { // PropertyName CallSignature{FunctionBody} is equivalent to PropertyName:function CallSignature{FunctionBody} var callSig1 = { num: function num(n1) { - return ""; + return ''; } }; var callSig1; var callSig2 = { num: function num(n1) { - return ""; + return ''; } }; var callSig2; var callSig3 = { num: function(n1) { - return ""; + return ''; } }; var callSig3; @@ -83,7 +83,7 @@ var getter1; // Get accessor only, type of the property is the inferred return type of the get accessor var getter2 = { get x () { - return ""; + return ''; } }; var getter2; @@ -149,12 +149,12 @@ var getParamType1 = { var y; }, get n () { - return ""; + return ''; } }; var getParamType2 = { get n () { - return ""; + return ''; }, set n (x){ var y1 = x; @@ -164,7 +164,7 @@ var getParamType2 = { // Type of unannotated accessors is the inferred return type of the get accessor var getParamType3 = { get n () { - return ""; + return ''; }, set n (x){ var y2 = x; diff --git a/crates/swc/tests/tsc-references/objectLiteralNormalization.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralNormalization.1.normal.js index dac05014d2c4..8bcf1beadfc7 100644 --- a/crates/swc/tests/tsc-references/objectLiteralNormalization.1.normal.js +++ b/crates/swc/tests/tsc-references/objectLiteralNormalization.1.normal.js @@ -76,14 +76,14 @@ var c4 = !true ? {} : { // Normalization applies to nested properties var d1 = [ { - kind: "a", + kind: 'a', pos: { x: 0, y: 0 } }, { - kind: "b", + kind: 'b', pos: !true ? { a: "x" } : { diff --git a/crates/swc/tests/tsc-references/objectRestParameterES5.1.normal.js b/crates/swc/tests/tsc-references/objectRestParameterES5.1.normal.js index fcc52cc63560..d25ddc132a4e 100644 --- a/crates/swc/tests/tsc-references/objectRestParameterES5.1.normal.js +++ b/crates/swc/tests/tsc-references/objectRestParameterES5.1.normal.js @@ -19,7 +19,7 @@ suddenly(function() { z: 1, ka: 1 }, - y: "noo" + y: 'noo' }; var _param_x = _param.x, _param_x_z = _param_x.z, z = _param_x_z === void 0 ? 12 : _param_x_z, nested = _object_without_properties(_param.x, [ "z" @@ -61,10 +61,10 @@ function foobar() { } foobar(); foobar({ - baz: "hello" + baz: 'hello' }); foobar({ bar: { - greeting: "hello" + greeting: 'hello' } }); diff --git a/crates/swc/tests/tsc-references/objectRestParameterES5.2.minified.js b/crates/swc/tests/tsc-references/objectRestParameterES5.2.minified.js index 29e605930bcb..fc1df2fd59ed 100644 --- a/crates/swc/tests/tsc-references/objectRestParameterES5.2.minified.js +++ b/crates/swc/tests/tsc-references/objectRestParameterES5.2.minified.js @@ -18,7 +18,7 @@ suddenly(function(_param) { z: 1, ka: 1 }, - y: "noo" + y: 'noo' }, nested = (_param.x.z, _object_without_properties(_param.x, [ "z" ])); @@ -26,9 +26,9 @@ suddenly(function(_param) { "x" ]).y + nested.ka; }), foobar(), foobar({ - baz: "hello" + baz: 'hello' }), foobar({ bar: { - greeting: "hello" + greeting: 'hello' } }); diff --git a/crates/swc/tests/tsc-references/objectRestReadonly.1.normal.js b/crates/swc/tests/tsc-references/objectRestReadonly.1.normal.js index 0deb4db728ba..7066801ee36b 100644 --- a/crates/swc/tests/tsc-references/objectRestReadonly.1.normal.js +++ b/crates/swc/tests/tsc-references/objectRestReadonly.1.normal.js @@ -2,9 +2,9 @@ // #23734 import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties"; var obj = { - foo: "bar", - baz: "qux", - quux: "quuz" + foo: 'bar', + baz: 'qux', + quux: 'quuz' }; var foo = obj.foo, rest = _object_without_properties(obj, [ "foo" diff --git a/crates/swc/tests/tsc-references/objectRestReadonly.2.minified.js b/crates/swc/tests/tsc-references/objectRestReadonly.2.minified.js index 0eae6fd8a8f7..9ca82a3d6d5f 100644 --- a/crates/swc/tests/tsc-references/objectRestReadonly.2.minified.js +++ b/crates/swc/tests/tsc-references/objectRestReadonly.2.minified.js @@ -1,9 +1,9 @@ //// [objectRestReadonly.ts] import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties"; var obj = { - foo: "bar", - baz: "qux", - quux: "quuz" + foo: 'bar', + baz: 'qux', + quux: 'quuz' }; obj.foo; var rest = _object_without_properties(obj, [ diff --git a/crates/swc/tests/tsc-references/objectSpread.1.normal.js b/crates/swc/tests/tsc-references/objectSpread.1.normal.js index d92d0d6c6b04..35bb8cab310c 100644 --- a/crates/swc/tests/tsc-references/objectSpread.1.normal.js +++ b/crates/swc/tests/tsc-references/objectSpread.1.normal.js @@ -5,14 +5,14 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread"; import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props"; var o = { a: 1, - b: "no" + b: 'no' }; var o2 = { - b: "yes", + b: 'yes', c: true }; var swap = { - a: "yes", + a: 'yes', b: -1 }; var addAfter = _object_spread_props(_object_spread({}, o), { @@ -22,25 +22,25 @@ var addBefore = _object_spread({ c: false }, o); var override = _object_spread_props(_object_spread({}, o), { - b: "override" + b: 'override' }); var nested = _object_spread_props(_object_spread({}, _object_spread({ a: 3 }, { b: false, - c: "overriden" + c: 'overriden' })), { - c: "whatever" + c: 'whatever' }); var combined = _object_spread({}, o, o2); var combinedAfter = _object_spread_props(_object_spread({}, o, o2), { - b: "ok" + b: 'ok' }); var combinedNestedChangeType = _object_spread_props(_object_spread({}, _object_spread({ a: 1 }, { b: false, - c: "overriden" + c: 'overriden' })), { c: -1 }); @@ -94,7 +94,7 @@ function conditionalSpreadNumber(nt) { } function conditionalSpreadString(st) { var o = { - x: "hi", + x: 'hi', y: 17 }; o = _object_spread({}, o, st && { @@ -130,7 +130,7 @@ var cplus = _object_spread_props(_object_spread({}, c), { cplus.plus(); // new field's type conflicting with existing field is OK var changeTypeAfter = _object_spread_props(_object_spread({}, o), { - a: "wrong type?" + a: 'wrong type?' }); var changeTypeBoth = _object_spread({}, o, swap); // optional @@ -139,12 +139,12 @@ function container(definiteBoolean, definiteString, optionalString, optionalNumb var optionalUnionDuplicates = _object_spread({}, definiteBoolean, definiteString, optionalString, optionalNumber); var allOptional = _object_spread({}, optionalString, optionalNumber); // computed property - var computedFirst = _object_spread_props(_object_spread(_define_property({}, "before everything", 12), o), { - b: "yes" + var computedFirst = _object_spread_props(_object_spread(_define_property({}, 'before everything', 12), o), { + b: 'yes' }); var computedAfter = _object_spread_props(_object_spread({}, o), _define_property({ - b: "yeah" - }, "at the end", 14)); + b: 'yeah' + }, 'at the end', 14)); } // shortcut syntax var a = 12; @@ -156,33 +156,33 @@ var spreadNonPrimitive = _object_spread({}, {}); // generic spreads function f(t, u) { return _object_spread_props(_object_spread({}, t, u), { - id: "id" + id: 'id' }); } var exclusive = f({ a: 1, - b: "yes" + b: 'yes' }, { - c: "no", + c: 'no', d: false }); var overlap = f({ a: 1 }, { a: 2, - b: "extra" + b: 'extra' }); var overlapConflict = f({ a: 1 }, { - a: "mismatch" + a: 'mismatch' }); var overwriteId = f({ a: 1, id: true }, { c: 1, - d: "no" + d: 'no' }); function genericSpread(t, u, v, w, obj) { var x01 = _object_spread({}, t); @@ -191,28 +191,28 @@ function genericSpread(t, u, v, w, obj) { var x04 = _object_spread({}, u, t); var x05 = _object_spread({ a: 5, - b: "hi" + b: 'hi' }, t); var x06 = _object_spread_props(_object_spread({}, t), { a: 5, - b: "hi" + b: 'hi' }); var x07 = _object_spread(_object_spread_props(_object_spread({ a: 5, - b: "hi" + b: 'hi' }, t), { c: true }), obj); var x09 = _object_spread(_object_spread_props(_object_spread({ a: 5 }, t), { - b: "hi", + b: 'hi', c: true }), obj); var x10 = _object_spread(_object_spread_props(_object_spread({ a: 5 }, t), { - b: "hi" + b: 'hi' }), u, obj); var x11 = _object_spread({}, v); var x12 = _object_spread({}, v, obj); diff --git a/crates/swc/tests/tsc-references/objectSpread.2.minified.js b/crates/swc/tests/tsc-references/objectSpread.2.minified.js index 95a59cf4b505..34b74c6fc5ae 100644 --- a/crates/swc/tests/tsc-references/objectSpread.2.minified.js +++ b/crates/swc/tests/tsc-references/objectSpread.2.minified.js @@ -5,9 +5,9 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread"; import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props"; var anything, o = { a: 1, - b: "no" + b: 'no' }, o2 = { - b: "yes", + b: 'yes', c: !0 }; _object_spread_props(_object_spread({}, o), { @@ -15,21 +15,21 @@ _object_spread_props(_object_spread({}, o), { }), _object_spread({ c: !1 }, o), _object_spread_props(_object_spread({}, o), { - b: "override" + b: 'override' }), _object_spread_props(_object_spread({}, _object_spread({ a: 3 }, { b: !1, - c: "overriden" + c: 'overriden' })), { - c: "whatever" + c: 'whatever' }), _object_spread({}, o, o2), _object_spread_props(_object_spread({}, o, o2), { - b: "ok" + b: 'ok' }), _object_spread_props(_object_spread({}, _object_spread({ a: 1 }, { b: !1, - c: "overriden" + c: 'overriden' })), { c: -1 }), _object_spread({}, o), _object_spread_props(_object_spread({}, { @@ -47,7 +47,7 @@ var c = new (function() { }())(); function f(t, u) { return _object_spread_props(_object_spread({}, t, u), { - id: "id" + id: 'id' }); } _object_spread({}, c), _object_spread_props(_object_spread({}, c), { @@ -55,31 +55,31 @@ _object_spread({}, c), _object_spread_props(_object_spread({}, c), { return this.p + 1; } }).plus(), _object_spread_props(_object_spread({}, o), { - a: "wrong type?" + a: 'wrong type?' }), _object_spread({}, o, { - a: "yes", + a: 'yes', b: -1 }), _object_spread_props(_object_spread({}, o), { a: 12 }), _object_spread({}, {}), f({ a: 1, - b: "yes" + b: 'yes' }, { - c: "no", + c: 'no', d: !1 }), f({ a: 1 }, { a: 2, - b: "extra" + b: 'extra' }), f({ a: 1 }, { - a: "mismatch" + a: 'mismatch' }), f({ a: 1, id: !0 }, { c: 1, - d: "no" + d: 'no' }); diff --git a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject.1.normal.js b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject.1.normal.js index 73d0daa46722..637f82b9df00 100644 --- a/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypeHidingMembersOfExtendedObject.1.normal.js @@ -28,20 +28,20 @@ var C = /*#__PURE__*/ function() { var c; var r1 = c.valueOf(); var r1b = c.data; -var r1c = r1b["hm"]; // should be 'Object' -var r1d = c["hm"]; // should be 'any' +var r1c = r1b['hm']; // should be 'Object' +var r1d = c['hm']; // should be 'any' var i; var r2 = i.valueOf(); var r2b = i.data; -var r2c = r2b["hm"]; // should be 'Object' -var r2d = i["hm"]; // should be 'any' +var r2c = r2b['hm']; // should be 'Object' +var r2d = i['hm']; // should be 'any' var a = { valueOf: function() {}, data: new B() }; var r3 = a.valueOf(); var r3b = a.data; -var r3c = r3b["hm"]; // should be 'Object' -var r3d = i["hm"]; +var r3c = r3b['hm']; // should be 'Object' +var r3d = i['hm']; var b; var r4 = b.valueOf(); diff --git a/crates/swc/tests/tsc-references/objectTypePropertyAccess.1.normal.js b/crates/swc/tests/tsc-references/objectTypePropertyAccess.1.normal.js index bbd45a006112..99d6bb1cc05c 100644 --- a/crates/swc/tests/tsc-references/objectTypePropertyAccess.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypePropertyAccess.1.normal.js @@ -7,18 +7,18 @@ var C = function C() { }; var c; var r1 = c.toString(); -var r2 = c["toString"](); +var r2 = c['toString'](); var r3 = c.foo; -var r4 = c["foo"]; +var r4 = c['foo']; var i; var r4 = i.toString(); -var r5 = i["toString"](); +var r5 = i['toString'](); var r6 = i.bar; -var r7 = i["bar"]; +var r7 = i['bar']; var a = { - foo: "" + foo: '' }; var r8 = a.toString(); -var r9 = a["toString"](); +var r9 = a['toString'](); var r10 = a.foo; -var r11 = a["foo"]; +var r11 = a['foo']; diff --git a/crates/swc/tests/tsc-references/objectTypePropertyAccess.2.minified.js b/crates/swc/tests/tsc-references/objectTypePropertyAccess.2.minified.js index 26f98ff427d5..d44b14ea1b55 100644 --- a/crates/swc/tests/tsc-references/objectTypePropertyAccess.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypePropertyAccess.2.minified.js @@ -2,6 +2,6 @@ import "@swc/helpers/_/_class_call_check"; c.toString(), c.toString(), c.foo, c.foo, i.toString(), i.toString(), i.bar, i.bar; var c, i, a = { - foo: "" + foo: '' }; a.toString(), a.toString(), a.foo, a.foo; diff --git a/crates/swc/tests/tsc-references/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.1.normal.js b/crates/swc/tests/tsc-references/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.1.normal.js index 4c38f8faaefe..bdfa706bb342 100644 --- a/crates/swc/tests/tsc-references/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.1.normal.js @@ -6,10 +6,10 @@ var r1 = i.apply; var r1b = i.call; var r1c = i.arguments; var r1d = i.data; -var r1e = i["hm"]; // should be Object +var r1e = i['hm']; // should be Object var x; var r2 = x.apply; var r2b = x.call; var r2c = x.arguments; var r2d = x.data; -var r2e = x["hm"]; // should be Object +var r2e = x['hm']; // should be Object diff --git a/crates/swc/tests/tsc-references/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.1.normal.js b/crates/swc/tests/tsc-references/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.1.normal.js index 1e86aa267c09..6f621f78b160 100644 --- a/crates/swc/tests/tsc-references/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.1.normal.js @@ -4,10 +4,10 @@ var r1 = i.apply; var r1b = i.call; var r1c = i.arguments; var r1d = i.data; -var r1e = i["hm"]; // should be Object +var r1e = i['hm']; // should be Object var x; var r2 = x.apply; var r2b = x.call; var r2c = x.arguments; var r2d = x.data; -var r2e = x["hm"]; // should be Object +var r2e = x['hm']; // should be Object diff --git a/crates/swc/tests/tsc-references/objectTypeWithNumericProperty.1.normal.js b/crates/swc/tests/tsc-references/objectTypeWithNumericProperty.1.normal.js index ff271187c279..ef249963c995 100644 --- a/crates/swc/tests/tsc-references/objectTypeWithNumericProperty.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypeWithNumericProperty.1.normal.js @@ -8,23 +8,23 @@ var C = function C() { var c; var r1 = c[1]; var r2 = c[1.1]; -var r3 = c["1"]; -var r4 = c["1.1"]; +var r3 = c['1']; +var r4 = c['1.1']; var i; var r1 = i[1]; var r2 = i[1.1]; -var r3 = i["1"]; -var r4 = i["1.1"]; +var r3 = i['1']; +var r4 = i['1.1']; var a; var r1 = a[1]; var r2 = a[1.1]; -var r3 = a["1"]; -var r4 = a["1.1"]; +var r3 = a['1']; +var r4 = a['1.1']; var b = { 1: 1, 1.1: "" }; var r1 = b[1]; var r2 = b[1.1]; -var r3 = b["1"]; -var r4 = b["1.1"]; +var r3 = b['1']; +var r4 = b['1.1']; diff --git a/crates/swc/tests/tsc-references/objectTypeWithNumericProperty.2.minified.js b/crates/swc/tests/tsc-references/objectTypeWithNumericProperty.2.minified.js index ad7d5ae7e431..659ceab5a8f0 100644 --- a/crates/swc/tests/tsc-references/objectTypeWithNumericProperty.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypeWithNumericProperty.2.minified.js @@ -1,8 +1,8 @@ //// [objectTypeWithNumericProperty.ts] import "@swc/helpers/_/_class_call_check"; -c[1], c[1.1], c["1"], c["1.1"], i[1], i[1.1], i["1"], i["1.1"], a[1], a[1.1], a["1"], a["1.1"]; +c[1], c[1.1], c['1'], c['1.1'], i[1], i[1.1], i['1'], i['1.1'], a[1], a[1.1], a['1'], a['1.1']; var c, i, a, b = { 1: 1, 1.1: "" }; -b[1], b[1.1], b["1"], b["1.1"]; +b[1], b[1.1], b['1'], b['1.1']; diff --git a/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer.1.normal.js b/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer.1.normal.js index d25c24d6c39f..723ab8e3e101 100644 --- a/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer.1.normal.js @@ -3,14 +3,14 @@ // no errors expected below import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var o = {}; -var r = o[""]; // should be Object +var r = o['']; // should be Object var C = function C() { "use strict"; _class_call_check(this, C); }; var c; -var r2 = c[""]; +var r2 = c['']; var i; -var r3 = i[""]; +var r3 = i['']; var o2; -var r4 = o2[""]; +var r4 = o2['']; diff --git a/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer.2.minified.js b/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer.2.minified.js index d4d60f0a541b..4252d938963f 100644 --- a/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypeWithStringIndexerHidingObjectIndexer.2.minified.js @@ -1,4 +1,4 @@ //// [objectTypeWithStringIndexerHidingObjectIndexer.ts] var c, i, o2; import "@swc/helpers/_/_class_call_check"; -c[""], i[""], o2[""]; +c[''], i[''], o2['']; diff --git a/crates/swc/tests/tsc-references/objectTypeWithStringNamedPropertyOfIllegalCharacters.1.normal.js b/crates/swc/tests/tsc-references/objectTypeWithStringNamedPropertyOfIllegalCharacters.1.normal.js index 6487d0413564..68ceb110b393 100644 --- a/crates/swc/tests/tsc-references/objectTypeWithStringNamedPropertyOfIllegalCharacters.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypeWithStringNamedPropertyOfIllegalCharacters.1.normal.js @@ -9,26 +9,26 @@ var r = c[" "]; var r2 = c[" "]; var r3 = c["a b"]; // BUG 817263 -var r4 = c["~!@#$%^&*()_+{}|:'<>?/.,`"]; +var r4 = c["~!@#$%^&*()_+{}|:'<>?\/.,`"]; var i; var r = i[" "]; var r2 = i[" "]; var r3 = i["a b"]; // BUG 817263 -var r4 = i["~!@#$%^&*()_+{}|:'<>?/.,`"]; +var r4 = i["~!@#$%^&*()_+{}|:'<>?\/.,`"]; var a; var r = a[" "]; var r2 = a[" "]; var r3 = a["a b"]; // BUG 817263 -var r4 = a["~!@#$%^&*()_+{}|:'<>?/.,`"]; +var r4 = a["~!@#$%^&*()_+{}|:'<>?\/.,`"]; var b = { " ": 1, "a b": "", - "~!@#$%^&*()_+{}|:'<>?/.,`": 1 + "~!@#$%^&*()_+{}|:'<>?\/.,`": 1 }; var r = b[" "]; var r2 = b[" "]; var r3 = b["a b"]; // BUG 817263 -var r4 = b["~!@#$%^&*()_+{}|:'<>?/.,`"]; +var r4 = b["~!@#$%^&*()_+{}|:'<>?\/.,`"]; diff --git a/crates/swc/tests/tsc-references/objectTypeWithStringNamedPropertyOfIllegalCharacters.2.minified.js b/crates/swc/tests/tsc-references/objectTypeWithStringNamedPropertyOfIllegalCharacters.2.minified.js index 1309b651e566..7b3e7a5ee675 100644 --- a/crates/swc/tests/tsc-references/objectTypeWithStringNamedPropertyOfIllegalCharacters.2.minified.js +++ b/crates/swc/tests/tsc-references/objectTypeWithStringNamedPropertyOfIllegalCharacters.2.minified.js @@ -1,9 +1,9 @@ //// [objectTypeWithStringNamedPropertyOfIllegalCharacters.ts] import "@swc/helpers/_/_class_call_check"; -c[" "], c[" "], c["a b"], c["~!@#$%^&*()_+{}|:'<>?/.,`"], i[" "], i[" "], i["a b"], i["~!@#$%^&*()_+{}|:'<>?/.,`"], a[" "], a[" "], a["a b"], a["~!@#$%^&*()_+{}|:'<>?/.,`"]; +c[" "], c[" "], c["a b"], c["~!@#$%^&*()_+{}|:'<>?\/.,`"], i[" "], i[" "], i["a b"], i["~!@#$%^&*()_+{}|:'<>?\/.,`"], a[" "], a[" "], a["a b"], a["~!@#$%^&*()_+{}|:'<>?\/.,`"]; var c, i, a, b = { " ": 1, "a b": "", - "~!@#$%^&*()_+{}|:'<>?/.,`": 1 + "~!@#$%^&*()_+{}|:'<>?\/.,`": 1 }; -b[" "], b[" "], b["a b"], b["~!@#$%^&*()_+{}|:'<>?/.,`"]; +b[" "], b[" "], b["a b"], b["~!@#$%^&*()_+{}|:'<>?\/.,`"]; diff --git a/crates/swc/tests/tsc-references/objectTypesIdentity.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentity.1.normal.js index b0367de9492b..0af7c0453b18 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentity.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentity.1.normal.js @@ -15,7 +15,7 @@ var C = function C() { }; var a; var b = { - foo: "" + foo: '' }; function foo1(x) {} function foo1b(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures.1.normal.js index 54e324b61c99..67c0ee8efaae 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures.1.normal.js @@ -37,7 +37,7 @@ var C = /*#__PURE__*/ function() { var a; var b = { foo: function foo(x) { - return ""; + return ''; } }; function foo1(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures2.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures2.1.normal.js index 27950e40c9f8..cffcd6ce2d58 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures2.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignatures2.1.normal.js @@ -37,7 +37,7 @@ var C = /*#__PURE__*/ function() { var a; var b = { foo: function foo(x) { - return ""; + return ''; } }; function foo1(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts.1.normal.js index beb5f886ca14..07f592a955e0 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesDifferingParamCounts.1.normal.js @@ -37,7 +37,7 @@ var C = /*#__PURE__*/ function() { var a; var b = { foo: function foo(x) { - return ""; + return ''; } }; function foo1(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesWithOverloads.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesWithOverloads.1.normal.js index 686771cdf139..46fe15f6d99e 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesWithOverloads.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithCallSignaturesWithOverloads.1.normal.js @@ -37,7 +37,7 @@ var C = /*#__PURE__*/ function() { var a; var b = { foo: function foo(x) { - return ""; + return ''; } }; function foo1(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures2.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures2.1.normal.js index 00b9e2797388..eac41bc29cfe 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures2.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignatures2.1.normal.js @@ -14,7 +14,7 @@ var C = function C(x) { var a; var b = { new: function _new(x) { - return ""; + return ''; } }; // not a construct signature, function called new function foo1b(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.1.normal.js index 89fc263d575c..9dc8194cb428 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.1.normal.js @@ -14,7 +14,7 @@ var C = function C(x, y) { var a; var b = { new: function _new(x) { - return ""; + return ''; } }; // not a construct signature, function called new function foo1b(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.1.normal.js index 24b9eaa3a441..12cdab9f562a 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.1.normal.js @@ -39,7 +39,7 @@ var C = /*#__PURE__*/ function() { var a; var b = { foo: function foo(x) { - return ""; + return ''; } }; function foo1(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.1.normal.js index 419c78b53089..80eac15703e1 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.1.normal.js @@ -50,7 +50,7 @@ var D = /*#__PURE__*/ function() { var a; var b = { foo: function foo(x, y) { - return ""; + return ''; } }; function foo1(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.1.normal.js index a6b529f0a364..872f3d5ab27b 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.1.normal.js @@ -58,7 +58,7 @@ var D = /*#__PURE__*/ function() { var a; var b = { foo: function foo(x, y) { - return ""; + return ''; } }; function foo1(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.1.normal.js index e0474b996e10..0d4099ecc9e0 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.1.normal.js @@ -16,7 +16,7 @@ var C = function C(x) { var a; var b = { new: function _new(x) { - return ""; + return ''; } }; // not a construct signature, function called new function foo1b(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.1.normal.js index aa6b1b452269..a3b0e33d5093 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.1.normal.js @@ -21,7 +21,7 @@ var D = function D(x, y) { var a; var b = { new: function _new(x, y) { - return ""; + return ''; } }; // not a construct signature, function called new function foo1b(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.1.normal.js index a08d3c82340b..e59c0415339b 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.1.normal.js @@ -29,7 +29,7 @@ var D = function D(x, y) { var a; var b = { new: function _new(x, y) { - return ""; + return ''; } }; // not a construct signature, function called new function foo1b(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1.1.normal.js index ab8e58ae6ed0..72d3318bcd10 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers1.1.normal.js @@ -37,7 +37,7 @@ var PB = /*#__PURE__*/ function(B) { }(B); var a; var b = { - 0: "" + 0: '' }; function foo1(x) {} function foo1b(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3.1.normal.js index 3c069e21758e..35e6c26213e9 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithNumericIndexers3.1.normal.js @@ -37,7 +37,7 @@ var PB = /*#__PURE__*/ function(B) { }(B); var a; var b = { - 0: "" + 0: '' }; function foo1(x) {} function foo1b(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithOptionality.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithOptionality.1.normal.js index 3d2c43d12d35..f3fa7d989930 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithOptionality.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithOptionality.1.normal.js @@ -15,7 +15,7 @@ var C = function C() { }; var a; var b = { - foo: "" + foo: '' }; function foo2(x) {} function foo3(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates.1.normal.js index 399b0604d64f..c73152a3fe31 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithPrivates.1.normal.js @@ -37,7 +37,7 @@ var PB = /*#__PURE__*/ function(B) { }(B); var a; var b = { - foo: "" + foo: '' }; function foo1(x) {} function foo1b(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithPublics.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithPublics.1.normal.js index 23e9f50e1631..b622486d0aa0 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithPublics.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithPublics.1.normal.js @@ -15,7 +15,7 @@ var C = function C() { }; var a; var b = { - foo: "" + foo: '' }; function foo1(x) {} function foo1b(x) {} diff --git a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers.1.normal.js b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers.1.normal.js index 46cc3cb801df..ba2209f14212 100644 --- a/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers.1.normal.js +++ b/crates/swc/tests/tsc-references/objectTypesIdentityWithStringIndexers.1.normal.js @@ -37,7 +37,7 @@ var PB = /*#__PURE__*/ function(B) { }(B); var a; var b = { - foo: "" + foo: '' }; function foo1(x) {} function foo1b(x) {} diff --git a/crates/swc/tests/tsc-references/optionalChainingInLoop.1.normal.js b/crates/swc/tests/tsc-references/optionalChainingInLoop.1.normal.js index d0c0f4491a23..5a861b9abd5f 100644 --- a/crates/swc/tests/tsc-references/optionalChainingInLoop.1.normal.js +++ b/crates/swc/tests/tsc-references/optionalChainingInLoop.1.normal.js @@ -6,7 +6,7 @@ try { var _loop = function() { var comp = _step.value; comp.sp.y = comp.sp.r.find(function(k) { - return k.c == (comp.xp ? "1" : "0"); + return k.c == (comp.xp ? '1' : '0'); }); var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { diff --git a/crates/swc/tests/tsc-references/optionalChainingInLoop.2.minified.js b/crates/swc/tests/tsc-references/optionalChainingInLoop.2.minified.js index dc6bd4e74a66..e25451317367 100644 --- a/crates/swc/tests/tsc-references/optionalChainingInLoop.2.minified.js +++ b/crates/swc/tests/tsc-references/optionalChainingInLoop.2.minified.js @@ -4,7 +4,7 @@ try { for(var _step, _iterator = [][Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0)!function() { var comp = _step.value; comp.sp.y = comp.sp.r.find(function(k) { - return k.c == (comp.xp ? "1" : "0"); + return k.c == (comp.xp ? '1' : '0'); }); var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0; try { diff --git a/crates/swc/tests/tsc-references/overloadResolution.1.normal.js b/crates/swc/tests/tsc-references/overloadResolution.1.normal.js index a3bcdf965dbc..1128c444ad5c 100644 --- a/crates/swc/tests/tsc-references/overloadResolution.1.normal.js +++ b/crates/swc/tests/tsc-references/overloadResolution.1.normal.js @@ -49,34 +49,34 @@ function fn2() { var d = fn2(0, undefined); var d; // Generic and non - generic overload where generic overload is the only candidate when called without type arguments -var s = fn2(0, ""); +var s = fn2(0, ''); // Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments -fn2("", 0); // Error +fn2('', 0); // Error // Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments -fn2("", 0); // OK +fn2('', 0); // OK function fn3() { return null; } var s = fn3(3); -var s = fn3("", 3, ""); +var s = fn3('', 3, ''); var n = fn3(5, 5, 5); var n; // Generic overloads with differing arity called with type arguments matching each overload type parameter count var s = fn3(4); -var s = fn3("", "", ""); -var n = fn3("", "", 3); +var s = fn3('', '', ''); +var n = fn3('', '', 3); // Generic overloads with differing arity called with type argument count that doesn't match any overload fn3(); // Error function fn4() {} -fn4("", 3); -fn4(3, ""); // Error -fn4("", 3); // Error -fn4(3, ""); +fn4('', 3); +fn4(3, ''); // Error +fn4('', 3); // Error +fn4(3, ''); // Generic overloads with constraints called without type arguments but with types that satisfy the constraints -fn4("", 3); -fn4(3, ""); +fn4('', 3); +fn4(3, ''); fn4(3, undefined); -fn4("", null); +fn4('', null); // Generic overloads with constraints called with type arguments that do not satisfy the constraints fn4(null, null); // Error // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints diff --git a/crates/swc/tests/tsc-references/overloadResolutionClassConstructors.1.normal.js b/crates/swc/tests/tsc-references/overloadResolutionClassConstructors.1.normal.js index 55ac80e0e3c1..16ff297e22ee 100644 --- a/crates/swc/tests/tsc-references/overloadResolutionClassConstructors.1.normal.js +++ b/crates/swc/tests/tsc-references/overloadResolutionClassConstructors.1.normal.js @@ -51,23 +51,23 @@ var fn2 = function fn2() { }; var d = new fn2(0, undefined); // Generic and non - generic overload where generic overload is the only candidate when called without type arguments -var s = new fn2(0, ""); +var s = new fn2(0, ''); // Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments -new fn2("", 0); // OK +new fn2('', 0); // OK // Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments -new fn2("", 0); // OK +new fn2('', 0); // OK // Generic overloads with differing arity called without type arguments var fn3 = function fn3() { "use strict"; _class_call_check(this, fn3); }; new fn3(3); -new fn3("", 3, ""); +new fn3('', 3, ''); new fn3(5, 5, 5); // Generic overloads with differing arity called with type arguments matching each overload type parameter count new fn3(4); // Error -new fn3("", "", ""); // Error -new fn3("", "", 3); +new fn3('', '', ''); // Error +new fn3('', '', 3); // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error // Generic overloads with constraints called with type arguments that satisfy the constraints @@ -75,15 +75,15 @@ var fn4 = function fn4() { "use strict"; _class_call_check(this, fn4); }; -new fn4("", 3); -new fn4(3, ""); // Error -new fn4("", 3); // Error -new fn4(3, ""); // Error +new fn4('', 3); +new fn4(3, ''); // Error +new fn4('', 3); // Error +new fn4(3, ''); // Error // Generic overloads with constraints called without type arguments but with types that satisfy the constraints -new fn4("", 3); -new fn4(3, ""); // Error +new fn4('', 3); +new fn4(3, ''); // Error new fn4(3, undefined); // Error -new fn4("", null); +new fn4('', null); // Generic overloads with constraints called with type arguments that do not satisfy the constraints new fn4(null, null); // Error // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints diff --git a/crates/swc/tests/tsc-references/overloadResolutionClassConstructors.2.minified.js b/crates/swc/tests/tsc-references/overloadResolutionClassConstructors.2.minified.js index c32305fae92b..7412d0f1f0cc 100644 --- a/crates/swc/tests/tsc-references/overloadResolutionClassConstructors.2.minified.js +++ b/crates/swc/tests/tsc-references/overloadResolutionClassConstructors.2.minified.js @@ -9,15 +9,15 @@ new fn1(void 0), new fn1({}); var fn2 = function fn2() { _class_call_check(this, fn2); }; -new fn2(0, void 0), new fn2(0, ""), new fn2("", 0), new fn2("", 0); +new fn2(0, void 0), new fn2(0, ''), new fn2('', 0), new fn2('', 0); var fn3 = function fn3() { _class_call_check(this, fn3); }; -new fn3(3), new fn3("", 3, ""), new fn3(5, 5, 5), new fn3(4), new fn3("", "", ""), new fn3("", "", 3), new fn3(); +new fn3(3), new fn3('', 3, ''), new fn3(5, 5, 5), new fn3(4), new fn3('', '', ''), new fn3('', '', 3), new fn3(); var fn4 = function fn4() { _class_call_check(this, fn4); }; -new fn4("", 3), new fn4(3, ""), new fn4("", 3), new fn4(3, ""), new fn4("", 3), new fn4(3, ""), new fn4(3, void 0), new fn4("", null), new fn4(null, null), new fn4(!0, null), new fn4(null, !0); +new fn4('', 3), new fn4(3, ''), new fn4('', 3), new fn4(3, ''), new fn4('', 3), new fn4(3, ''), new fn4(3, void 0), new fn4('', null), new fn4(null, null), new fn4(!0, null), new fn4(null, !0); var fn5 = function fn5() { _class_call_check(this, fn5); }; diff --git a/crates/swc/tests/tsc-references/overloadResolutionConstructors.1.normal.js b/crates/swc/tests/tsc-references/overloadResolutionConstructors.1.normal.js index 913ddb4ff40f..0139706678ac 100644 --- a/crates/swc/tests/tsc-references/overloadResolutionConstructors.1.normal.js +++ b/crates/swc/tests/tsc-references/overloadResolutionConstructors.1.normal.js @@ -46,32 +46,32 @@ var fn2; var d = new fn2(0, undefined); var d; // Generic and non - generic overload where generic overload is the only candidate when called without type arguments -var s = new fn2(0, ""); +var s = new fn2(0, ''); // Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments -new fn2("", 0); // Error +new fn2('', 0); // Error // Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments -new fn2("", 0); // OK +new fn2('', 0); // OK var fn3; var s = new fn3(3); -var s = new fn3("", 3, ""); +var s = new fn3('', 3, ''); var n = new fn3(5, 5, 5); var n; // Generic overloads with differing arity called with type arguments matching each overload type parameter count var s = new fn3(4); -var s = new fn3("", "", ""); -var n = new fn3("", "", 3); +var s = new fn3('', '', ''); +var n = new fn3('', '', 3); // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error var fn4; -new fn4("", 3); -new fn4(3, ""); // Error -new fn4("", 3); // Error -new fn4(3, ""); +new fn4('', 3); +new fn4(3, ''); // Error +new fn4('', 3); // Error +new fn4(3, ''); // Generic overloads with constraints called without type arguments but with types that satisfy the constraints -new fn4("", 3); -new fn4(3, ""); +new fn4('', 3); +new fn4(3, ''); new fn4(3, undefined); -new fn4("", null); +new fn4('', null); // Generic overloads with constraints called with type arguments that do not satisfy the constraints new fn4(null, null); // Error // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints diff --git a/crates/swc/tests/tsc-references/overloadResolutionConstructors.2.minified.js b/crates/swc/tests/tsc-references/overloadResolutionConstructors.2.minified.js index 440e04aec946..5c17407c2654 100644 --- a/crates/swc/tests/tsc-references/overloadResolutionConstructors.2.minified.js +++ b/crates/swc/tests/tsc-references/overloadResolutionConstructors.2.minified.js @@ -3,7 +3,7 @@ var fn1, fn2, fn3, fn4, fn5; import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -new fn1(void 0), new fn1({}), new fn2(0, void 0), new fn2(0, ""), new fn2("", 0), new fn2("", 0), new fn3(3), new fn3("", 3, ""), new fn3(5, 5, 5), new fn3(4), new fn3("", "", ""), new fn3("", "", 3), new fn3(), new fn4("", 3), new fn4(3, ""), new fn4("", 3), new fn4(3, ""), new fn4("", 3), new fn4(3, ""), new fn4(3, void 0), new fn4("", null), new fn4(null, null), new fn4(!0, null), new fn4(null, !0), new fn5(function(n) { +new fn1(void 0), new fn1({}), new fn2(0, void 0), new fn2(0, ''), new fn2('', 0), new fn2('', 0), new fn3(3), new fn3('', 3, ''), new fn3(5, 5, 5), new fn3(4), new fn3('', '', ''), new fn3('', '', 3), new fn3(), new fn4('', 3), new fn4(3, ''), new fn4('', 3), new fn4(3, ''), new fn4('', 3), new fn4(3, ''), new fn4(3, void 0), new fn4('', null), new fn4(null, null), new fn4(!0, null), new fn4(null, !0), new fn5(function(n) { return n.toFixed(); }), new fn5(function(n) { return n.substr(0); diff --git a/crates/swc/tests/tsc-references/paramTagOnCallExpression.1.normal.js b/crates/swc/tests/tsc-references/paramTagOnCallExpression.1.normal.js index b199f3a988ee..df14a98c59db 100644 --- a/crates/swc/tests/tsc-references/paramTagOnCallExpression.1.normal.js +++ b/crates/swc/tests/tsc-references/paramTagOnCallExpression.1.normal.js @@ -1,4 +1,4 @@ //// [decls.d.ts] //// [a.js] // from util -/** @param {function} ctor - A big long explanation follows */ exports.inherits = factory("inherits"); +/** @param {function} ctor - A big long explanation follows */ exports.inherits = factory('inherits'); diff --git a/crates/swc/tests/tsc-references/paramTagOnCallExpression.2.minified.js b/crates/swc/tests/tsc-references/paramTagOnCallExpression.2.minified.js index 26395e1aab91..6c73d45da02b 100644 --- a/crates/swc/tests/tsc-references/paramTagOnCallExpression.2.minified.js +++ b/crates/swc/tests/tsc-references/paramTagOnCallExpression.2.minified.js @@ -1,3 +1,3 @@ //// [decls.d.ts] //// [a.js] -exports.inherits = factory("inherits"); +exports.inherits = factory('inherits'); diff --git a/crates/swc/tests/tsc-references/paramTagOnFunctionUsingArguments.1.normal.js b/crates/swc/tests/tsc-references/paramTagOnFunctionUsingArguments.1.normal.js index e3fb2faca5aa..b1e83217fd2c 100644 --- a/crates/swc/tests/tsc-references/paramTagOnFunctionUsingArguments.1.normal.js +++ b/crates/swc/tests/tsc-references/paramTagOnFunctionUsingArguments.1.normal.js @@ -3,7 +3,7 @@ /** * @param {string} first */ function concat() { - var s = ""; + var s = ''; for(var i = 0, l = arguments.length; i < l; i++){ s += arguments[i]; } diff --git a/crates/swc/tests/tsc-references/paramTagTypeResolution.1.normal.js b/crates/swc/tests/tsc-references/paramTagTypeResolution.1.normal.js index 3dd7b0de5d00..c364f3c0b67b 100644 --- a/crates/swc/tests/tsc-references/paramTagTypeResolution.1.normal.js +++ b/crates/swc/tests/tsc-references/paramTagTypeResolution.1.normal.js @@ -6,5 +6,5 @@ return k(x); }; //// [main.js] -var f = require("./first"); +var f = require('./first'); f(1, function(n) {}); diff --git a/crates/swc/tests/tsc-references/paramTagTypeResolution.2.minified.js b/crates/swc/tests/tsc-references/paramTagTypeResolution.2.minified.js index 32472a716ea6..5111e6702b19 100644 --- a/crates/swc/tests/tsc-references/paramTagTypeResolution.2.minified.js +++ b/crates/swc/tests/tsc-references/paramTagTypeResolution.2.minified.js @@ -3,4 +3,4 @@ module.exports = function(x, k) { return k(x); }; //// [main.js] -require("./first")(1, function(n) {}); +require('./first')(1, function(n) {}); diff --git a/crates/swc/tests/tsc-references/parserArgumentList1.1.normal.js b/crates/swc/tests/tsc-references/parserArgumentList1.1.normal.js index fb976f892959..16f789d20bc6 100644 --- a/crates/swc/tests/tsc-references/parserArgumentList1.1.normal.js +++ b/crates/swc/tests/tsc-references/parserArgumentList1.1.normal.js @@ -1,6 +1,6 @@ //// [parserArgumentList1.ts] export function removeClass(node, className) { node.className = node.className.replace(_classNameRegexp(className), function(everything, leftDelimiter, name, rightDelimiter) { - return leftDelimiter.length + rightDelimiter.length === 2 ? " " : ""; + return leftDelimiter.length + rightDelimiter.length === 2 ? ' ' : ''; }); } diff --git a/crates/swc/tests/tsc-references/parserArgumentList1.2.minified.js b/crates/swc/tests/tsc-references/parserArgumentList1.2.minified.js index fb976f892959..16f789d20bc6 100644 --- a/crates/swc/tests/tsc-references/parserArgumentList1.2.minified.js +++ b/crates/swc/tests/tsc-references/parserArgumentList1.2.minified.js @@ -1,6 +1,6 @@ //// [parserArgumentList1.ts] export function removeClass(node, className) { node.className = node.className.replace(_classNameRegexp(className), function(everything, leftDelimiter, name, rightDelimiter) { - return leftDelimiter.length + rightDelimiter.length === 2 ? " " : ""; + return leftDelimiter.length + rightDelimiter.length === 2 ? ' ' : ''; }); } diff --git a/crates/swc/tests/tsc-references/parserForInStatement8.1.normal.js b/crates/swc/tests/tsc-references/parserForInStatement8.1.normal.js index c0076db9a06a..9925a11ea329 100644 --- a/crates/swc/tests/tsc-references/parserForInStatement8.1.normal.js +++ b/crates/swc/tests/tsc-references/parserForInStatement8.1.normal.js @@ -2,14 +2,14 @@ // repro from https://github.com/microsoft/TypeScript/issues/54769 import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array"; for(var ref in { - "": 0 + '': 0 }){ - var _ref = _sliced_to_array(ref, 1), tmp = _ref[0], x = tmp === void 0 ? "a" in {} : tmp; + var _ref = _sliced_to_array(ref, 1), tmp = _ref[0], x = tmp === void 0 ? 'a' in {} : tmp; console.log(x); } for(var ref1 in { - "": 0 + '': 0 }){ - var _ref_x = ref1.x, x1 = _ref_x === void 0 ? "a" in {} : _ref_x; + var _ref_x = ref1.x, x1 = _ref_x === void 0 ? 'a' in {} : _ref_x; console.log(x1); } diff --git a/crates/swc/tests/tsc-references/parserForInStatement8.2.minified.js b/crates/swc/tests/tsc-references/parserForInStatement8.2.minified.js index 83cdeaa678fd..4e7624eead78 100644 --- a/crates/swc/tests/tsc-references/parserForInStatement8.2.minified.js +++ b/crates/swc/tests/tsc-references/parserForInStatement8.2.minified.js @@ -1,14 +1,14 @@ //// [parserForInStatement8.ts] import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array"; for(var ref in { - "": 0 + '': 0 }){ var tmp = _sliced_to_array(ref, 1)[0]; - console.log(void 0 === tmp ? "a" in {} : tmp); + console.log(void 0 === tmp ? 'a' in {} : tmp); } for(var ref1 in { - "": 0 + '': 0 }){ var _ref_x = ref1.x; - console.log(void 0 === _ref_x ? "a" in {} : _ref_x); + console.log(void 0 === _ref_x ? 'a' in {} : _ref_x); } diff --git a/crates/swc/tests/tsc-references/parserForStatement9.1.normal.js b/crates/swc/tests/tsc-references/parserForStatement9.1.normal.js index 57bb4d5f0ad5..9564e13a342f 100644 --- a/crates/swc/tests/tsc-references/parserForStatement9.1.normal.js +++ b/crates/swc/tests/tsc-references/parserForStatement9.1.normal.js @@ -1,4 +1,4 @@ //// [parserForStatement9.ts] // repro from https://github.com/microsoft/TypeScript/issues/54769 -for(var _ref = [], tmp = _ref[0], x = tmp === void 0 ? ("a" in {}) : tmp; !x; x = !x)console.log(x); -for(var _ref1 = {}, _ref_x = _ref1.x, x1 = _ref_x === void 0 ? ("a" in {}) : _ref_x; !x1; x1 = !x1)console.log(x1); +for(var _ref = [], tmp = _ref[0], x = tmp === void 0 ? ('a' in {}) : tmp; !x; x = !x)console.log(x); +for(var _ref1 = {}, _ref_x = _ref1.x, x1 = _ref_x === void 0 ? ('a' in {}) : _ref_x; !x1; x1 = !x1)console.log(x1); diff --git a/crates/swc/tests/tsc-references/parserForStatement9.2.minified.js b/crates/swc/tests/tsc-references/parserForStatement9.2.minified.js index c8531259d5a9..60c2ce4a14e0 100644 --- a/crates/swc/tests/tsc-references/parserForStatement9.2.minified.js +++ b/crates/swc/tests/tsc-references/parserForStatement9.2.minified.js @@ -1,3 +1,3 @@ //// [parserForStatement9.ts] -for(var tmp = [][0], x = void 0 === tmp ? ("a" in {}) : tmp; !x; x = !x)console.log(x); -for(var _ref_x = {}.x, x1 = void 0 === _ref_x ? ("a" in {}) : _ref_x; !x1; x1 = !x1)console.log(x1); +for(var tmp = [][0], x = void 0 === tmp ? ('a' in {}) : tmp; !x; x = !x)console.log(x); +for(var _ref_x = {}.x, x1 = void 0 === _ref_x ? ('a' in {}) : _ref_x; !x1; x1 = !x1)console.log(x1); diff --git a/crates/swc/tests/tsc-references/parserNotHexLiteral1.1.normal.js b/crates/swc/tests/tsc-references/parserNotHexLiteral1.1.normal.js index e1f1ac6e3976..dd5380b8d58b 100644 --- a/crates/swc/tests/tsc-references/parserNotHexLiteral1.1.normal.js +++ b/crates/swc/tests/tsc-references/parserNotHexLiteral1.1.normal.js @@ -1,7 +1,7 @@ //// [parserNotHexLiteral1.ts] var x = { - e0: "cat", - x0: "dog" + e0: 'cat', + x0: 'dog' }; console.info(x.x0); // tsc dies on this next line with "bug.ts (5,16): Expected ')'" diff --git a/crates/swc/tests/tsc-references/parserNotHexLiteral1.2.minified.js b/crates/swc/tests/tsc-references/parserNotHexLiteral1.2.minified.js index 7fa99c515d5d..eded0763a8af 100644 --- a/crates/swc/tests/tsc-references/parserNotHexLiteral1.2.minified.js +++ b/crates/swc/tests/tsc-references/parserNotHexLiteral1.2.minified.js @@ -1,2 +1,2 @@ //// [parserNotHexLiteral1.ts] -console.info("dog"), console.info("cat"); +console.info('dog'), console.info('cat'); diff --git a/crates/swc/tests/tsc-references/parserRealSource1.1.normal.js b/crates/swc/tests/tsc-references/parserRealSource1.1.normal.js index 97982e6e12e2..580b8cb9a859 100644 --- a/crates/swc/tests/tsc-references/parserRealSource1.1.normal.js +++ b/crates/swc/tests/tsc-references/parserRealSource1.1.normal.js @@ -146,10 +146,10 @@ var TypeScript; result += "\\r"; break; case 0x22: - result += '\\"'; + result += "\\\""; break; case 0x27: - result += "\\'"; + result += "\\\'"; break; case 0x5c: result += "\\"; diff --git a/crates/swc/tests/tsc-references/parserRealSource1.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource1.2.minified.js index e58e5887c2f5..2763b11317f5 100644 --- a/crates/swc/tests/tsc-references/parserRealSource1.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource1.2.minified.js @@ -84,10 +84,10 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; result += "\\r"; break; case 0x22: - result += '\\"'; + result += "\\\""; break; case 0x27: - result += "\\'"; + result += "\\\'"; break; case 0x5c: result += "\\"; diff --git a/crates/swc/tests/tsc-references/parserS7.2_A1.5_T2.1.normal.js b/crates/swc/tests/tsc-references/parserS7.2_A1.5_T2.1.normal.js index 8755a84a1a9a..f90e16d04548 100644 --- a/crates/swc/tests/tsc-references/parserS7.2_A1.5_T2.1.normal.js +++ b/crates/swc/tests/tsc-references/parserS7.2_A1.5_T2.1.normal.js @@ -7,12 +7,12 @@ * @path ch07/7.2/S7.2_A1.5_T2.js * @description Insert real NO-BREAK SPACE between tokens of var x=1 */ //CHECK#1 -eval("\xa0var x\xa0= 1\xa0"); +eval("\u00A0var x\u00A0= 1\u00A0"); if (x !== 1) { $ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + x); } //CHECK#2 var x = 1; if (x !== 1) { - $ERROR("#2: \xa0var x\xa0= 1\xa0; x === 1. Actual: " + x); + $ERROR('#2:  var x = 1 ; x === 1. Actual: ' + x); } diff --git a/crates/swc/tests/tsc-references/parserS7.2_A1.5_T2.2.minified.js b/crates/swc/tests/tsc-references/parserS7.2_A1.5_T2.2.minified.js index de2faa47266e..e663a4b585ed 100644 --- a/crates/swc/tests/tsc-references/parserS7.2_A1.5_T2.2.minified.js +++ b/crates/swc/tests/tsc-references/parserS7.2_A1.5_T2.2.minified.js @@ -1,4 +1,4 @@ //// [parserS7.2_A1.5_T2.ts] -eval("\xa0var x\xa0= 1\xa0"), 1 !== x && $ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + x); +eval("\u00A0var x\u00A0= 1\u00A0"), 1 !== x && $ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + x); var x = 1; -1 !== x && $ERROR("#2: \xa0var x\xa0= 1\xa0; x === 1. Actual: " + x); +1 !== x && $ERROR('#2:  var x = 1 ; x === 1. Actual: ' + x); diff --git a/crates/swc/tests/tsc-references/parserS7.3_A1.1_T2.1.normal.js b/crates/swc/tests/tsc-references/parserS7.3_A1.1_T2.1.normal.js index 19885d6454fe..fd28a4eba17e 100644 --- a/crates/swc/tests/tsc-references/parserS7.3_A1.1_T2.1.normal.js +++ b/crates/swc/tests/tsc-references/parserS7.3_A1.1_T2.1.normal.js @@ -9,5 +9,5 @@ */ //CHECK#1 var x = 1; if (x !== 1) { - $ERROR("#1: var\\nx\\n=\\n1\\n; x === 1. Actual: " + x); + $ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + x); } diff --git a/crates/swc/tests/tsc-references/parserS7.6_A4.2_T1.1.normal.js b/crates/swc/tests/tsc-references/parserS7.6_A4.2_T1.1.normal.js index fb05324d6fba..f14ca42c50a4 100644 --- a/crates/swc/tests/tsc-references/parserS7.6_A4.2_T1.1.normal.js +++ b/crates/swc/tests/tsc-references/parserS7.6_A4.2_T1.1.normal.js @@ -9,133 +9,133 @@ */ //CHECK#А-Я var А = 1; if (А !== 1) { - $ERROR("#А"); + $ERROR('#А'); } var Б = 1; if (Б !== 1) { - $ERROR("#Б"); + $ERROR('#Б'); } var В = 1; if (В !== 1) { - $ERROR("#В"); + $ERROR('#В'); } var Г = 1; if (Г !== 1) { - $ERROR("#Г"); + $ERROR('#Г'); } var Д = 1; if (Д !== 1) { - $ERROR("#Д"); + $ERROR('#Д'); } var Е = 1; if (Е !== 1) { - $ERROR("#Е"); + $ERROR('#Е'); } var Ж = 1; if (Ж !== 1) { - $ERROR("#Ж"); + $ERROR('#Ж'); } var З = 1; if (З !== 1) { - $ERROR("#З"); + $ERROR('#З'); } var И = 1; if (И !== 1) { - $ERROR("#И"); + $ERROR('#И'); } var Й = 1; if (Й !== 1) { - $ERROR("#Й"); + $ERROR('#Й'); } var К = 1; if (К !== 1) { - $ERROR("#К"); + $ERROR('#К'); } var Л = 1; if (Л !== 1) { - $ERROR("#Л"); + $ERROR('#Л'); } var М = 1; if (М !== 1) { - $ERROR("#М"); + $ERROR('#М'); } var Н = 1; if (Н !== 1) { - $ERROR("#Н"); + $ERROR('#Н'); } var О = 1; if (О !== 1) { - $ERROR("#О"); + $ERROR('#О'); } var П = 1; if (П !== 1) { - $ERROR("#П"); + $ERROR('#П'); } var Р = 1; if (Р !== 1) { - $ERROR("#Р"); + $ERROR('#Р'); } var С = 1; if (С !== 1) { - $ERROR("#С"); + $ERROR('#С'); } var Т = 1; if (Т !== 1) { - $ERROR("#Т"); + $ERROR('#Т'); } var У = 1; if (У !== 1) { - $ERROR("#У"); + $ERROR('#У'); } var Ф = 1; if (Ф !== 1) { - $ERROR("#Ф"); + $ERROR('#Ф'); } var Х = 1; if (Х !== 1) { - $ERROR("#Х"); + $ERROR('#Х'); } var Ц = 1; if (Ц !== 1) { - $ERROR("#Ц"); + $ERROR('#Ц'); } var Ч = 1; if (Ч !== 1) { - $ERROR("#Ч"); + $ERROR('#Ч'); } var Ш = 1; if (Ш !== 1) { - $ERROR("#Ш"); + $ERROR('#Ш'); } var Щ = 1; if (Щ !== 1) { - $ERROR("#Щ"); + $ERROR('#Щ'); } var Ъ = 1; if (Ъ !== 1) { - $ERROR("#Ъ"); + $ERROR('#Ъ'); } var Ы = 1; if (Ы !== 1) { - $ERROR("#Ы"); + $ERROR('#Ы'); } var Ь = 1; if (Ь !== 1) { - $ERROR("#Ь"); + $ERROR('#Ь'); } var Э = 1; if (Э !== 1) { - $ERROR("#Э"); + $ERROR('#Э'); } var Ю = 1; if (Ю !== 1) { - $ERROR("#Ю"); + $ERROR('#Ю'); } var Я = 1; if (Я !== 1) { - $ERROR("#Я"); + $ERROR('#Я'); } var Ё = 1; if (Ё !== 1) { - $ERROR("#Ё"); + $ERROR('#Ё'); } diff --git a/crates/swc/tests/tsc-references/parserUnicode1.1.normal.js b/crates/swc/tests/tsc-references/parserUnicode1.1.normal.js index 2cfda37c93b4..4aea4cb3a257 100644 --- a/crates/swc/tests/tsc-references/parserUnicode1.1.normal.js +++ b/crates/swc/tests/tsc-references/parserUnicode1.1.normal.js @@ -2,8 +2,8 @@ try { var xx = 6; if (xx !== 6) { - $ERROR("#6.1: var \\u0078x = 1; xx === 6. Actual: " + xx); + $ERROR('#6.1: var \\u0078x = 1; xx === 6. Actual: ' + xx); } } catch (e) { - $ERROR("#6.2: var \\u0078x = 1; xx === 6. Actual: " + xx); + $ERROR('#6.2: var \\u0078x = 1; xx === 6. Actual: ' + xx); } diff --git a/crates/swc/tests/tsc-references/parserUnicode1.2.minified.js b/crates/swc/tests/tsc-references/parserUnicode1.2.minified.js index d162669aefe7..6892e1362e4e 100644 --- a/crates/swc/tests/tsc-references/parserUnicode1.2.minified.js +++ b/crates/swc/tests/tsc-references/parserUnicode1.2.minified.js @@ -1,7 +1,7 @@ //// [parserUnicode1.ts] try { var xx = 6; - 6 !== xx && $ERROR("#6.1: var \\u0078x = 1; xx === 6. Actual: " + xx); + 6 !== xx && $ERROR('#6.1: var \\u0078x = 1; xx === 6. Actual: ' + xx); } catch (e) { - $ERROR("#6.2: var \\u0078x = 1; xx === 6. Actual: " + xx); + $ERROR('#6.2: var \\u0078x = 1; xx === 6. Actual: ' + xx); } diff --git a/crates/swc/tests/tsc-references/parserindenter.1.normal.js b/crates/swc/tests/tsc-references/parserindenter.1.normal.js index 453ced8b8c0c..3e7a6e4e4cae 100644 --- a/crates/swc/tests/tsc-references/parserindenter.1.normal.js +++ b/crates/swc/tests/tsc-references/parserindenter.1.normal.js @@ -45,7 +45,7 @@ var Formatting; if (this.logger.information()) { for(var i = 0; i < result.count(); i++){ var edit = result.get(i); - this.logger.log("edit: minChar=" + edit.position + ", limChar=" + (edit.position + edit.length) + ', text="' + TypeScript.stringToLiteral(edit.replaceWith, 30) + '"'); + this.logger.log("edit: minChar=" + edit.position + ", limChar=" + (edit.position + edit.length) + ", text=\"" + TypeScript.stringToLiteral(edit.replaceWith, 30) + "\""); } } return result; @@ -320,7 +320,7 @@ var Formatting; if (StringUtils.IsNullOrEmpty(existingIndentation)) return ""; var totalIndent = 0; StringUtils.foreach(existingIndentation, function(c) { - if (c == " ") totalIndent += tabSize; + if (c == '\t') totalIndent += tabSize; else totalIndent++; }); totalIndent += level * indentSize; @@ -331,7 +331,7 @@ var Formatting; return this.GetIndentString(existingIndentation, totalIndentSize, tabSize, convertTabsToSpaces); }; _proto.GetIndentString = function GetIndentString(prefix, totalIndentSize, tabSize, convertTabsToSpaces) { - var tabString = convertTabsToSpaces ? StringUtils.create(" ", tabSize) : " "; + var tabString = convertTabsToSpaces ? StringUtils.create(' ', tabSize) : "\t"; var text = ""; if (!StringUtils.IsNullOrEmpty(prefix)) text += prefix; var pos = 0; @@ -342,7 +342,7 @@ var Formatting; } // fill the reminder with spaces while(pos < totalIndentSize){ - text += " "; + text += ' '; pos++; } return text; @@ -502,7 +502,7 @@ var Formatting; var line = this.snapshot.GetLineFromPosition(offset); var lineText = line.getText(); var index = 0; - while(index < lineText.length && (lineText.charAt(index) == " " || lineText.charAt(index) == " ")){ + while(index < lineText.length && (lineText.charAt(index) == ' ' || lineText.charAt(index) == '\t')){ ++index; } return lineText.substr(0, index); @@ -551,8 +551,8 @@ var Formatting; var indentSize = 0; for(var i = 0; i < text.length; i++){ var c = text.charAt(i); - if (c == " ") indentSize = indentSize + editorOptions.TabSize - indentSize % editorOptions.TabSize; - else if (c == " ") indentSize += 1; + if (c == '\t') indentSize = indentSize + editorOptions.TabSize - indentSize % editorOptions.TabSize; + else if (c == ' ') indentSize += 1; else { if (includeNonIndentChars) indentSize += 1; else break; diff --git a/crates/swc/tests/tsc-references/parserindenter.2.minified.js b/crates/swc/tests/tsc-references/parserindenter.2.minified.js index c1cd2b944f19..5d5ab4e4e84b 100644 --- a/crates/swc/tests/tsc-references/parserindenter.2.minified.js +++ b/crates/swc/tests/tsc-references/parserindenter.2.minified.js @@ -11,7 +11,7 @@ Formatting1 = Formatting || (Formatting = {}), Indenter = function() { var result = this.GetIndentationEditsWorker(token, nextToken, node, sameLineIndent); if (this.logger.information()) for(var i = 0; i < result.count(); i++){ var edit = result.get(i); - this.logger.log("edit: minChar=" + edit.position + ", limChar=" + (edit.position + edit.length) + ', text="' + TypeScript.stringToLiteral(edit.replaceWith, 30) + '"'); + this.logger.log("edit: minChar=" + edit.position + ", limChar=" + (edit.position + edit.length) + ", text=\"" + TypeScript.stringToLiteral(edit.replaceWith, 30) + "\""); } return result; }, _proto.GetIndentationEditsWorker = function(token, nextToken, node, sameLineIndent) { @@ -126,15 +126,15 @@ Formatting1 = Formatting || (Formatting = {}), Indenter = function() { if (StringUtils.IsNullOrEmpty(existingIndentation)) return ""; var totalIndent = 0; return (StringUtils.foreach(existingIndentation, function(c) { - " " == c ? totalIndent += tabSize : totalIndent++; + '\t' == c ? totalIndent += tabSize : totalIndent++; }), (totalIndent += level * indentSize) < 0) ? "" : this.GetIndentString(null, totalIndent, tabSize, convertTabsToSpaces); } return this.GetIndentString(existingIndentation, level * indentSize, tabSize, convertTabsToSpaces); }, _proto.GetIndentString = function(prefix, totalIndentSize, tabSize, convertTabsToSpaces) { - var tabString = convertTabsToSpaces ? StringUtils.create(" ", tabSize) : " ", text = ""; + var tabString = convertTabsToSpaces ? StringUtils.create(' ', tabSize) : "\t", text = ""; StringUtils.IsNullOrEmpty(prefix) || (text += prefix); for(var pos = 0; pos <= totalIndentSize - tabSize;)text += tabString, pos += tabSize; - for(; pos < totalIndentSize;)text += " ", pos++; + for(; pos < totalIndentSize;)text += ' ', pos++; return text; }, _proto.ApplyIndentationDeltaFromParent = function(token, node) { for(var indentationInfo = null, indentableParent = node; null != indentableParent && !indentableParent.CanIndent();)indentableParent = indentableParent.Parent; @@ -195,7 +195,7 @@ Formatting1 = Formatting || (Formatting = {}), Indenter = function() { } }, _proto.GetLineIndentationForOffset = function(offset) { if (null != (indentationEdit = this.indentationBag.FindIndent(offset))) return indentationEdit.Indentation(); - for(var indentationEdit, lineText = this.snapshot.GetLineFromPosition(offset).getText(), index = 0; index < lineText.length && (" " == lineText.charAt(index) || " " == lineText.charAt(index));)++index; + for(var indentationEdit, lineText = this.snapshot.GetLineFromPosition(offset).getText(), index = 0; index < lineText.length && (' ' == lineText.charAt(index) || '\t' == lineText.charAt(index));)++index; return lineText.substr(0, index); }, _proto.RegisterIndentation = function(indent, sameLineIndent) { var indentationInfo = null; @@ -228,8 +228,8 @@ Formatting1 = Formatting || (Formatting = {}), Indenter = function() { }, Indenter.GetIndentSizeFromText = function(text, editorOptions, includeNonIndentChars) { for(var indentSize = 0, i = 0; i < text.length; i++){ var c = text.charAt(i); - if (" " == c) indentSize = indentSize + editorOptions.TabSize - indentSize % editorOptions.TabSize; - else if (" " == c) indentSize += 1; + if ('\t' == c) indentSize = indentSize + editorOptions.TabSize - indentSize % editorOptions.TabSize; + else if (' ' == c) indentSize += 1; else if (includeNonIndentChars) indentSize += 1; else break; } diff --git a/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions.1.normal.js b/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions.1.normal.js index cb0066e3a1f0..360b653e1ee9 100644 --- a/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions.1.normal.js +++ b/crates/swc/tests/tsc-references/propertiesOfGenericConstructorFunctions.1.normal.js @@ -13,10 +13,10 @@ function Multimap(ik, iv) { /** @type {Multimap<"a" | "b", number>} with type annotation */ var map = new Multimap("a", 1); // without type annotation var map2 = new Multimap("m", 2); -/** @type {number} */ var n = map._map["hi"]; -/** @type {number} */ var n = map._map2["hi"]; -/** @type {number} */ var n = map2._map["hi"]; -/** @type {number} */ var n = map._map2["hi"]; +/** @type {number} */ var n = map._map['hi']; +/** @type {number} */ var n = map._map2['hi']; +/** @type {number} */ var n = map2._map['hi']; +/** @type {number} */ var n = map._map2['hi']; /** * @class * @template T diff --git a/crates/swc/tests/tsc-references/propertyAccess.1.normal.js b/crates/swc/tests/tsc-references/propertyAccess.1.normal.js index 1b7f4bf1d3f0..d08e35190c81 100644 --- a/crates/swc/tests/tsc-references/propertyAccess.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAccess.1.normal.js @@ -24,27 +24,27 @@ var Compass; Compass[Compass["West"] = 3] = "West"; })(Compass || (Compass = {})); var numIndex = { - 3: "three", - "three": "three" + 3: 'three', + 'three': 'three' }; var strIndex = { - "N": 0, - "E": 2 + 'N': 0, + 'E': 2 }; var bothIndex; function noIndex() {} var obj = { - 10: "ten", - x: "hello", + 10: 'ten', + x: 'hello', y: 32, z: { - n: "world", + n: 'world', m: 15, o: function() { return false; } }, - "literal property": 100 + 'literal property': 100 }; var anyVar = {}; var stringOrNumber; @@ -60,16 +60,16 @@ var bb = obj.hasOwnProperty; // Dotted property access of property that doesn't exist on value's apparent type var cc = obj.qqq; // error // Bracket notation property access using string literal value on type with property of that literal name -var dd = obj["literal property"]; +var dd = obj['literal property']; var dd; // Bracket notation property access using string literal value on type without property of that literal name -var ee = obj["wa wa wa wa wa"]; +var ee = obj['wa wa wa wa wa']; var ee; // Bracket notation property access using numeric string literal value on type with property of that literal name -var ff = obj["10"]; +var ff = obj['10']; var ff; // Bracket notation property access using numeric string literal value on type without property of that literal name -var gg = obj["1"]; +var gg = obj['1']; var gg; // Bracket notation property access using numeric value on type with numeric index signature var hh = numIndex[3.0]; @@ -81,14 +81,14 @@ var ii; var jj = numIndex[anyVar]; var jj; // Bracket notation property access using string value on type with numeric index signature -var kk = numIndex["what"]; +var kk = numIndex['what']; var kk; // Bracket notation property access using value of other type on type with numeric index signature and no string index signature var ll = numIndex[someObject]; // Error // Bracket notation property access using string value on type with string index signature and no numeric index signature -var mm = strIndex["N"]; +var mm = strIndex['N']; var mm; -var mm2 = strIndex["zzz"]; +var mm2 = strIndex['zzz']; var mm2; // Bracket notation property access using numeric value on type with string index signature and no numeric index signature var nn = strIndex[10]; @@ -103,7 +103,7 @@ var pp; var qq = noIndex[123]; var qq; // Bracket notation property access using string value on type with no index signatures -var rr = noIndex["zzzz"]; +var rr = noIndex['zzzz']; var rr; // Bracket notation property access using enum value on type with no index signatures var ss = noIndex[1]; @@ -123,10 +123,10 @@ var ww; var xx = bothIndex[null]; var xx; // Bracket notation property access using string value on type with numeric index signature and string index signature -var yy = bothIndex["foo"]; +var yy = bothIndex['foo']; var yy; // Bracket notation property access using numeric string value on type with numeric index signature and string index signature -var zz = bothIndex["1.0"]; +var zz = bothIndex['1.0']; var zz; // Bracket notation property access using value of other type on type with numeric index signature and no string index signature and string index signature var zzzz = bothIndex[someObject]; // Error diff --git a/crates/swc/tests/tsc-references/propertyAccess.2.minified.js b/crates/swc/tests/tsc-references/propertyAccess.2.minified.js index bfe94aaed9bd..312f35c545a8 100644 --- a/crates/swc/tests/tsc-references/propertyAccess.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyAccess.2.minified.js @@ -4,24 +4,24 @@ import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; (Compass1 = Compass || (Compass = {}))[Compass1.North = 0] = "North", Compass1[Compass1.South = 1] = "South", Compass1[Compass1.East = 2] = "East", Compass1[Compass1.West = 3] = "West"; var Compass, bothIndex, stringOrNumber, someObject, Compass1, numIndex = { - 3: "three", - three: "three" + 3: 'three', + three: 'three' }, strIndex = { N: 0, E: 2 }; function noIndex() {} var obj = { - 10: "ten", - x: "hello", + 10: 'ten', + x: 'hello', y: 32, z: { - n: "world", + n: 'world', m: 15, o: function() { return !1; } }, - "literal property": 100 + 'literal property': 100 }, anyVar = {}; -obj.y = 4, anyVar.x = anyVar.y = obj.x = anyVar.z, obj.x, obj.hasOwnProperty, obj.qqq, obj["literal property"], obj["wa wa wa wa wa"], obj["10"], obj["1"], numIndex[3.0], numIndex[1], numIndex[anyVar], numIndex.what, numIndex[someObject], strIndex.N, strIndex.zzz, strIndex[10], strIndex[2], strIndex[null], noIndex[123], noIndex[1], noIndex[null], noIndex[someObject], noIndex[32], bothIndex[2], bothIndex[null], bothIndex.foo, bothIndex["1.0"], bothIndex[someObject], numIndex[stringOrNumber], strIndex[stringOrNumber], bothIndex[stringOrNumber]; +obj.y = 4, anyVar.x = anyVar.y = obj.x = anyVar.z, obj.x, obj.hasOwnProperty, obj.qqq, obj['literal property'], obj['wa wa wa wa wa'], obj['10'], obj['1'], numIndex[3.0], numIndex[1], numIndex[anyVar], numIndex.what, numIndex[someObject], strIndex.N, strIndex.zzz, strIndex[10], strIndex[2], strIndex[null], noIndex[123], noIndex[1], noIndex[null], noIndex[someObject], noIndex[32], bothIndex[2], bothIndex[null], bothIndex.foo, bothIndex['1.0'], bothIndex[someObject], numIndex[stringOrNumber], strIndex[stringOrNumber], bothIndex[stringOrNumber]; diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints.1.normal.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints.1.normal.js index bc4563f68aab..dc020650080a 100644 --- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints.1.normal.js @@ -10,7 +10,7 @@ var C = /*#__PURE__*/ function() { var _proto = C.prototype; _proto.f = function f() { var x; - var a = x["getDate"](); // number + var a = x['getDate'](); // number return a + x.getDate(); }; return C; @@ -18,13 +18,13 @@ var C = /*#__PURE__*/ function() { var r = new C().f(); var i; var r2 = i.foo.getDate(); -var r2b = i.foo["getDate"](); +var r2b = i.foo['getDate'](); var a; var r3 = a().getDate(); -var r3b = a()["getDate"](); +var r3b = a()['getDate'](); var b = { foo: function(x) { - var a = x["getDate"](); // number + var a = x['getDate'](); // number return a + x.getDate(); } }; diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2.1.normal.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2.1.normal.js index 8e3ac7ef2c00..b9d03f8cfde3 100644 --- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2.1.normal.js @@ -10,7 +10,7 @@ var A = /*#__PURE__*/ function() { } var _proto = A.prototype; _proto.foo = function foo() { - return ""; + return ''; }; return A; }(); @@ -24,7 +24,7 @@ var B = /*#__PURE__*/ function(A) { } var _proto = B.prototype; _proto.bar = function bar() { - return ""; + return ''; }; return B; }(A); @@ -36,11 +36,11 @@ var C = /*#__PURE__*/ function() { var _proto = C.prototype; _proto.f = function f() { var x; - var a = x["foo"](); // should be string + var a = x['foo'](); // should be string return a + x.foo(); }; _proto.g = function g(x) { - var a = x["foo"](); // should be string + var a = x['foo'](); // should be string return a + x.foo(); }; return C; @@ -63,7 +63,7 @@ var r1b = new C().g(new B()); //} var i; var r2 = i.foo.foo(); -var r2b = i.foo["foo"](); +var r2b = i.foo['foo'](); var a; //var a: { // (): U; @@ -71,14 +71,14 @@ var a; // (x: U, y: T): U; //} var r3 = a().foo(); -var r3b = a()["foo"](); +var r3b = a()['foo'](); // parameter supplied for type argument inference to succeed var aB = new B(); var r3c = a(aB, aB).foo(); -var r3d = a(aB, aB)["foo"](); +var r3d = a(aB, aB)['foo'](); var b = { foo: function(x, y) { - var a = x["foo"](); // should be string + var a = x['foo'](); // should be string return a + x.foo(); } }; diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2.2.minified.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2.2.minified.js index b1c4ceaa3bc4..e104833e5741 100644 --- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints2.2.minified.js @@ -9,14 +9,14 @@ var i, a, B = function(A) { return _class_call_check(this, B), _super.apply(this, arguments); } return B.prototype.bar = function() { - return ""; + return ''; }, B; }(function() { function A() { _class_call_check(this, A); } return A.prototype.foo = function() { - return ""; + return ''; }, A; }()), C = function() { function C() { diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3.1.normal.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3.1.normal.js index df519257a56e..599384f59733 100644 --- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3.1.normal.js @@ -10,7 +10,7 @@ var A = /*#__PURE__*/ function() { } var _proto = A.prototype; _proto.foo = function foo() { - return ""; + return ''; }; return A; }(); @@ -24,7 +24,7 @@ var B = /*#__PURE__*/ function(A) { } var _proto = B.prototype; _proto.bar = function bar() { - return ""; + return ''; }; return B; }(A); @@ -37,12 +37,12 @@ var C = /*#__PURE__*/ function() { _proto.f = function f() { var x; // BUG 823818 - var a = x["foo"](); // should be string + var a = x['foo'](); // should be string return a + x.foo(); }; _proto.g = function g(x) { // BUG 823818 - var a = x["foo"](); // should be string + var a = x['foo'](); // should be string return a + x.foo(); }; return C; @@ -51,17 +51,17 @@ var r1a = new C().f(); var r1b = new C().g(new B()); var i; var r2 = i.foo.foo(); -var r2b = i.foo["foo"](); +var r2b = i.foo['foo'](); var a; var r3 = a().foo(); // error, no inferences for U so it doesn't satisfy constraint -var r3b = a()["foo"](); +var r3b = a()['foo'](); // parameter supplied for type argument inference for U var r3c = a(new B()).foo(); // valid call to an invalid function, U is inferred as B, which has a foo -var r3d = a(new B())["foo"](); // valid call to an invalid function, U is inferred as B, which has a foo +var r3d = a(new B())['foo'](); // valid call to an invalid function, U is inferred as B, which has a foo var b = { foo: function(x) { // BUG 823818 - var a = x["foo"](); // should be string + var a = x['foo'](); // should be string return a + x.foo(); } }; diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3.2.minified.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3.2.minified.js index dde99f847db6..014685a438e6 100644 --- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints3.2.minified.js @@ -9,14 +9,14 @@ var i, a, B = function(A) { return _class_call_check(this, B), _super.apply(this, arguments); } return B.prototype.bar = function() { - return ""; + return ''; }, B; }(function() { function A() { _class_call_check(this, A); } return A.prototype.foo = function() { - return ""; + return ''; }, A; }()), C = function() { function C() { diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints4.1.normal.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints4.1.normal.js index 39b5d3a10791..6b26c7296ef9 100644 --- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints4.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints4.1.normal.js @@ -8,7 +8,7 @@ var C = /*#__PURE__*/ function() { var _proto = C.prototype; _proto.f = function f() { var x; - var a = x["notHere"](); // should be string + var a = x['notHere'](); // should be string return a + x.notHere(); }; return C; @@ -16,13 +16,13 @@ var C = /*#__PURE__*/ function() { var r = new C().f(); var i; var r2 = i.foo.notHere(); -var r2b = i.foo["notHere"](); +var r2b = i.foo['notHere'](); var a; var r3 = a().notHere(); -var r3b = a()["notHere"](); +var r3b = a()['notHere'](); var b = { foo: function(x) { - var a = x["notHere"](); // should be string + var a = x['notHere'](); // should be string return a + x.notHere(); }, bar: b.foo().notHere() diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5.1.normal.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5.1.normal.js index 58a6269cc7c4..dab0fd8312e1 100644 --- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5.1.normal.js @@ -9,7 +9,7 @@ var A = /*#__PURE__*/ function() { } var _proto = A.prototype; _proto.foo = function foo() { - return ""; + return ''; }; return A; }(); @@ -23,7 +23,7 @@ var B = /*#__PURE__*/ function(A) { } var _proto = B.prototype; _proto.bar = function bar() { - return ""; + return ''; }; return B; }(A); @@ -35,7 +35,7 @@ var C = /*#__PURE__*/ function() { var _proto = C.prototype; _proto.f = function f() { var x; - var a = x["foo"](); // should be string + var a = x['foo'](); // should be string return a + x.foo() + x.notHere(); }; return C; @@ -43,14 +43,14 @@ var C = /*#__PURE__*/ function() { var r = new C().f(); var i; var r2 = i.foo.notHere(); -var r2b = i.foo["foo"](); +var r2b = i.foo['foo'](); var a; // BUG 794164 var r3 = a().notHere(); -var r3b = a()["foo"](); +var r3b = a()['foo'](); var b = { foo: function(x) { - var a = x["foo"](); // should be string + var a = x['foo'](); // should be string return a + x.notHere(); }, // BUG 794164 diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5.2.minified.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5.2.minified.js index c96be3ab186f..feb04ff9d372 100644 --- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithConstraints5.2.minified.js @@ -9,14 +9,14 @@ var i, a, B = function(A) { return _class_call_check(this, B), _super.apply(this, arguments); } return B.prototype.bar = function() { - return ""; + return ''; }, B; }(function() { function A() { _class_call_check(this, A); } return A.prototype.foo = function() { - return ""; + return ''; }, A; }()); new (function() { diff --git a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithoutConstraints.1.normal.js b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithoutConstraints.1.normal.js index 2b7194c6ba1c..658572d06137 100644 --- a/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithoutConstraints.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAccessOnTypeParameterWithoutConstraints.1.normal.js @@ -8,7 +8,7 @@ var C = /*#__PURE__*/ function() { var _proto = C.prototype; _proto.f = function f() { var x; - var a = x["toString"](); // should be string + var a = x['toString'](); // should be string return a + x.toString(); }; return C; @@ -16,13 +16,13 @@ var C = /*#__PURE__*/ function() { var r = new C().f(); var i; var r2 = i.foo.toString(); -var r2b = i.foo["toString"](); +var r2b = i.foo['toString'](); var a; var r3 = a().toString(); -var r3b = a()["toString"](); +var r3b = a()['toString'](); var b = { foo: function(x) { - var a = x["toString"](); // should be string + var a = x['toString'](); // should be string return a + x.toString(); } }; diff --git a/crates/swc/tests/tsc-references/propertyAccessStringIndexSignature.1.normal.js b/crates/swc/tests/tsc-references/propertyAccessStringIndexSignature.1.normal.js index 9f6e43a188dc..1ab7e15c455f 100644 --- a/crates/swc/tests/tsc-references/propertyAccessStringIndexSignature.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAccessStringIndexSignature.1.normal.js @@ -3,7 +3,7 @@ var flags; flags.b; flags.f; flags.isNotNecessarilyNeverFalse; -flags["this is fine"]; +flags['this is fine']; var empty; empty.nope; empty["that's ok"]; diff --git a/crates/swc/tests/tsc-references/propertyAccessStringIndexSignature.2.minified.js b/crates/swc/tests/tsc-references/propertyAccessStringIndexSignature.2.minified.js index 4357521f24f4..6ffe8d68803d 100644 --- a/crates/swc/tests/tsc-references/propertyAccessStringIndexSignature.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyAccessStringIndexSignature.2.minified.js @@ -1,3 +1,3 @@ //// [propertyAccessStringIndexSignature.ts] var flags, empty; -flags.b, flags.f, flags.isNotNecessarilyNeverFalse, flags["this is fine"], empty.nope, empty["that's ok"]; +flags.b, flags.f, flags.isNotNecessarilyNeverFalse, flags['this is fine'], empty.nope, empty["that's ok"]; diff --git a/crates/swc/tests/tsc-references/propertyAccessStringIndexSignatureNoImplicitAny.1.normal.js b/crates/swc/tests/tsc-references/propertyAccessStringIndexSignatureNoImplicitAny.1.normal.js index fb5558231f76..1a6ce7feab64 100644 --- a/crates/swc/tests/tsc-references/propertyAccessStringIndexSignatureNoImplicitAny.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAccessStringIndexSignatureNoImplicitAny.1.normal.js @@ -3,7 +3,7 @@ var flags; flags.b; flags.f; flags.isNotNecessarilyNeverFalse; -flags["this is fine"]; +flags['this is fine']; var empty; empty.nope; empty["not allowed either"]; diff --git a/crates/swc/tests/tsc-references/propertyAccessStringIndexSignatureNoImplicitAny.2.minified.js b/crates/swc/tests/tsc-references/propertyAccessStringIndexSignatureNoImplicitAny.2.minified.js index 437af53991cc..72d4ef99d9c0 100644 --- a/crates/swc/tests/tsc-references/propertyAccessStringIndexSignatureNoImplicitAny.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyAccessStringIndexSignatureNoImplicitAny.2.minified.js @@ -1,3 +1,3 @@ //// [propertyAccessStringIndexSignatureNoImplicitAny.ts] var flags, empty; -flags.b, flags.f, flags.isNotNecessarilyNeverFalse, flags["this is fine"], empty.nope, empty["not allowed either"]; +flags.b, flags.f, flags.isNotNecessarilyNeverFalse, flags['this is fine'], empty.nope, empty["not allowed either"]; diff --git a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol.1.normal.js b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol.1.normal.js index 33d9c4a66a38..ee66dc2041fa 100644 --- a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol.1.normal.js @@ -1,5 +1,5 @@ //// [mod1.js] export var hurk = {}; //// [bug24658.js] -import { hurk } from "./mod1"; +import { hurk } from './mod1'; hurk.expando = 4; diff --git a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol.2.minified.js b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol.2.minified.js index 33d9c4a66a38..ee66dc2041fa 100644 --- a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol.2.minified.js @@ -1,5 +1,5 @@ //// [mod1.js] export var hurk = {}; //// [bug24658.js] -import { hurk } from "./mod1"; +import { hurk } from './mod1'; hurk.expando = 4; diff --git a/crates/swc/tests/tsc-references/propertyAssignmentOnUnresolvedImportedSymbol.1.normal.js b/crates/swc/tests/tsc-references/propertyAssignmentOnUnresolvedImportedSymbol.1.normal.js index e535a73205af..aac98778630c 100644 --- a/crates/swc/tests/tsc-references/propertyAssignmentOnUnresolvedImportedSymbol.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyAssignmentOnUnresolvedImportedSymbol.1.normal.js @@ -1,5 +1,5 @@ //// [bug28576.js] -import x from "arglebaz"; +import x from 'arglebaz'; { x.bar = 1; } diff --git a/crates/swc/tests/tsc-references/propertyAssignmentOnUnresolvedImportedSymbol.2.minified.js b/crates/swc/tests/tsc-references/propertyAssignmentOnUnresolvedImportedSymbol.2.minified.js index 9b020db6f45d..6299b8e3c686 100644 --- a/crates/swc/tests/tsc-references/propertyAssignmentOnUnresolvedImportedSymbol.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyAssignmentOnUnresolvedImportedSymbol.2.minified.js @@ -1,3 +1,3 @@ //// [bug28576.js] -import x from "arglebaz"; +import x from 'arglebaz'; x.bar = 1; diff --git a/crates/swc/tests/tsc-references/propertyOverridesAccessors4.1.normal.js b/crates/swc/tests/tsc-references/propertyOverridesAccessors4.1.normal.js index 13a20fb3d541..3ba7b46185f8 100644 --- a/crates/swc/tests/tsc-references/propertyOverridesAccessors4.1.normal.js +++ b/crates/swc/tests/tsc-references/propertyOverridesAccessors4.1.normal.js @@ -12,7 +12,7 @@ var Lion = /*#__PURE__*/ function(Animal1) { _class_call_check(this, Lion); var _this; _this = _super.apply(this, arguments); - _define_property(_assert_this_initialized(_this), "sound", "RAWR!" // error here + _define_property(_assert_this_initialized(_this), "sound", 'RAWR!' // error here ); return _this; } diff --git a/crates/swc/tests/tsc-references/quotedConstructors.1.normal.js b/crates/swc/tests/tsc-references/quotedConstructors.1.normal.js index 85210bf4ae90..2061a27c2017 100644 --- a/crates/swc/tests/tsc-references/quotedConstructors.1.normal.js +++ b/crates/swc/tests/tsc-references/quotedConstructors.1.normal.js @@ -16,7 +16,7 @@ var E = /*#__PURE__*/ function() { _class_call_check(this, E); } var _proto = E.prototype; - _proto["constructor"] = function() { + _proto['constructor'] = function() { console.log(this); }; return E; diff --git a/crates/swc/tests/tsc-references/reExportJsFromTs.1.normal.js b/crates/swc/tests/tsc-references/reExportJsFromTs.1.normal.js index fb5658caf54d..ff5a94f293ed 100644 --- a/crates/swc/tests/tsc-references/reExportJsFromTs.1.normal.js +++ b/crates/swc/tests/tsc-references/reExportJsFromTs.1.normal.js @@ -1,7 +1,7 @@ //// [reExportJsFromTs.ts] //// [/lib/constants.js] module.exports = { - str: "x" + str: 'x' }; //// [/src/constants.ts] import * as tsConstants from "../lib/constants"; diff --git a/crates/swc/tests/tsc-references/reExportJsFromTs.2.minified.js b/crates/swc/tests/tsc-references/reExportJsFromTs.2.minified.js index fb5658caf54d..ff5a94f293ed 100644 --- a/crates/swc/tests/tsc-references/reExportJsFromTs.2.minified.js +++ b/crates/swc/tests/tsc-references/reExportJsFromTs.2.minified.js @@ -1,7 +1,7 @@ //// [reExportJsFromTs.ts] //// [/lib/constants.js] module.exports = { - str: "x" + str: 'x' }; //// [/src/constants.ts] import * as tsConstants from "../lib/constants"; diff --git a/crates/swc/tests/tsc-references/readonlyArraysAndTuples2.1.normal.js b/crates/swc/tests/tsc-references/readonlyArraysAndTuples2.1.normal.js index 8d5969422044..84aa2d3e93f4 100644 --- a/crates/swc/tests/tsc-references/readonlyArraysAndTuples2.1.normal.js +++ b/crates/swc/tests/tsc-references/readonlyArraysAndTuples2.1.normal.js @@ -7,7 +7,7 @@ var A = function A() { _class_call_check(this, A); this.j = []; this.k = [ - "foo", + 'foo', 42 ]; }; diff --git a/crates/swc/tests/tsc-references/readonlyArraysAndTuples2.2.minified.js b/crates/swc/tests/tsc-references/readonlyArraysAndTuples2.2.minified.js index 589c3d0fbe7d..9ffd537ba454 100644 --- a/crates/swc/tests/tsc-references/readonlyArraysAndTuples2.2.minified.js +++ b/crates/swc/tests/tsc-references/readonlyArraysAndTuples2.2.minified.js @@ -4,7 +4,7 @@ import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate"; import { _ as _ts_metadata } from "@swc/helpers/_/_ts_metadata"; var A = function A() { _class_call_check(this, A), this.j = [], this.k = [ - "foo", + 'foo', 42 ]; }; diff --git a/crates/swc/tests/tsc-references/readonlyRestParameters.1.normal.js b/crates/swc/tests/tsc-references/readonlyRestParameters.1.normal.js index 027a884cbf43..927b0e6c0b25 100644 --- a/crates/swc/tests/tsc-references/readonlyRestParameters.1.normal.js +++ b/crates/swc/tests/tsc-references/readonlyRestParameters.1.normal.js @@ -10,9 +10,9 @@ function f1() { args[_key] = arguments[_key]; } f0.apply(void 0, _to_consumable_array(args)); // Error - f1("abc", "def"); + f1('abc', 'def'); f1.apply(void 0, [ - "abc" + 'abc' ].concat(_to_consumable_array(args))); f1.apply(void 0, _to_consumable_array(args)); } @@ -21,14 +21,14 @@ function f2() { args[_key] = arguments[_key]; } f0.apply(void 0, _to_consumable_array(args)); - f1("abc", "def"); + f1('abc', 'def'); f1.apply(void 0, [ - "abc" + 'abc' ].concat(_to_consumable_array(args))); f1.apply(void 0, _to_consumable_array(args)); - f2("abc", "def"); + f2('abc', 'def'); f2.apply(void 0, [ - "abc" + 'abc' ].concat(_to_consumable_array(args))); // Error f2.apply(void 0, _to_consumable_array(args)); } @@ -36,5 +36,5 @@ function f4() { for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ args[_key] = arguments[_key]; } - args[0] = "abc"; // Error + args[0] = 'abc'; // Error } diff --git a/crates/swc/tests/tsc-references/recursiveInitializer.1.normal.js b/crates/swc/tests/tsc-references/recursiveInitializer.1.normal.js index a64dbbedc80c..6610ff81f457 100644 --- a/crates/swc/tests/tsc-references/recursiveInitializer.1.normal.js +++ b/crates/swc/tests/tsc-references/recursiveInitializer.1.normal.js @@ -4,10 +4,10 @@ var n1 = n1++; var n2 = n2 + n2; var n3 /* any */ = n3 + n3; // string unless otherwise specified -var s1 = s1 + ""; +var s1 = s1 + ''; var s2 /* any */ = s2 + s2; var s3 = s3 + s3; -var s4 = "" + s4; +var s4 = '' + s4; // boolean unless otherwise specified var b1 = !b1; var b2 = !!b2; diff --git a/crates/swc/tests/tsc-references/recursiveTypeReferences1.1.normal.js b/crates/swc/tests/tsc-references/recursiveTypeReferences1.1.normal.js index 11319a9605f4..50ff935270a0 100644 --- a/crates/swc/tests/tsc-references/recursiveTypeReferences1.1.normal.js +++ b/crates/swc/tests/tsc-references/recursiveTypeReferences1.1.normal.js @@ -125,7 +125,7 @@ flat([ ]); // number[] flat([ 1, - "a", + 'a', [ 2 ] @@ -134,13 +134,13 @@ flat([ 1, [ 2, - "a" + 'a' ] ]); // (string | number)[] flat([ 1, [ - "a" + 'a' ] ]); // Error flat1([ @@ -161,7 +161,7 @@ flat1([ ]); // number[][] flat1([ 1, - "a", + 'a', [ 2 ] @@ -170,13 +170,13 @@ flat1([ 1, [ 2, - "a" + 'a' ] ]); // (string | number)[] flat1([ 1, [ - "a" + 'a' ] ]); // Error flat2([ @@ -197,7 +197,7 @@ flat2([ ]); // number[] flat2([ 1, - "a", + 'a', [ 2 ] @@ -206,29 +206,29 @@ flat2([ 1, [ 2, - "a" + 'a' ] ]); // (string | number)[] flat2([ 1, [ - "a" + 'a' ] ]); // Error var x1 = foo1(ra1); // Boom! var x2 = foo2(ra2); // Boom! function parse(node) { var index = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; - return html("ul", node.map(function(param, i) { + return html('ul', node.map(function(param, i) { var _param = _sliced_to_array(param, 2), el = _param[0], children = _param[1]; var idx = _to_consumable_array(index).concat([ i + 1 ]); - return html("li", [ - html("a", { + return html('li', [ + html('a', { href: "#".concat(el.id), - rel: "noopener", - "data-index": idx.join(".") + rel: 'noopener', + 'data-index': idx.join('.') }, el.textContent), children.length > 0 ? parse(children, idx) : frag() ]); diff --git a/crates/swc/tests/tsc-references/recursiveTypeReferences1.2.minified.js b/crates/swc/tests/tsc-references/recursiveTypeReferences1.2.minified.js index c62f7d18c82f..3070ea8ac43b 100644 --- a/crates/swc/tests/tsc-references/recursiveTypeReferences1.2.minified.js +++ b/crates/swc/tests/tsc-references/recursiveTypeReferences1.2.minified.js @@ -39,7 +39,7 @@ flat([ ] ]), flat([ 1, - "a", + 'a', [ 2 ] @@ -47,12 +47,12 @@ flat([ 1, [ 2, - "a" + 'a' ] ]), flat([ 1, [ - "a" + 'a' ] ]), flat1([ 1, @@ -70,7 +70,7 @@ flat([ ] ]), flat1([ 1, - "a", + 'a', [ 2 ] @@ -78,12 +78,12 @@ flat([ 1, [ 2, - "a" + 'a' ] ]), flat1([ 1, [ - "a" + 'a' ] ]), flat2([ 1, @@ -101,7 +101,7 @@ flat([ ] ]), flat2([ 1, - "a", + 'a', [ 2 ] @@ -109,11 +109,11 @@ flat([ 1, [ 2, - "a" + 'a' ] ]), flat2([ 1, [ - "a" + 'a' ] ]), foo1(ra1), foo2(ra2); diff --git a/crates/swc/tests/tsc-references/recursiveTypesWithTypeof.1.normal.js b/crates/swc/tests/tsc-references/recursiveTypesWithTypeof.1.normal.js index 442c9af1dce8..ed61046bff0f 100644 --- a/crates/swc/tests/tsc-references/recursiveTypesWithTypeof.1.normal.js +++ b/crates/swc/tests/tsc-references/recursiveTypesWithTypeof.1.normal.js @@ -32,7 +32,7 @@ var j2 = new j2(j2); // Indexers var k; var k = k[0]; -var k = k[""]; +var k = k['']; // Hybrid - contains type literals as well as type arguments // These two are recursive var hy1; diff --git a/crates/swc/tests/tsc-references/recursiveTypesWithTypeof.2.minified.js b/crates/swc/tests/tsc-references/recursiveTypesWithTypeof.2.minified.js index f7ae3550572d..f4d39ecc0605 100644 --- a/crates/swc/tests/tsc-references/recursiveTypesWithTypeof.2.minified.js +++ b/crates/swc/tests/tsc-references/recursiveTypesWithTypeof.2.minified.js @@ -1,2 +1,2 @@ //// [recursiveTypesWithTypeof.ts] -var h, i, j, h2, i2, j2, k, hy1, hy2, h = h(), i = i(i), j = j(j), h2 = new h2(), i2 = new i2(i2), j2 = new j2(j2), k = k[0], k = k[""], hy1 = hy1[0].x, hy2 = hy2.x[0]; +var h, i, j, h2, i2, j2, k, hy1, hy2, h = h(), i = i(i), j = j(j), h2 = new h2(), i2 = new i2(i2), j2 = new j2(j2), k = k[0], k = k[''], hy1 = hy1[0].x, hy2 = hy2.x[0]; diff --git a/crates/swc/tests/tsc-references/requireAssertsFromTypescript.1.normal.js b/crates/swc/tests/tsc-references/requireAssertsFromTypescript.1.normal.js index 4a8abb84e1a7..fb50b11e6e01 100644 --- a/crates/swc/tests/tsc-references/requireAssertsFromTypescript.1.normal.js +++ b/crates/swc/tests/tsc-references/requireAssertsFromTypescript.1.normal.js @@ -10,8 +10,8 @@ export { }; //! : ^^^^^^^^^^^^^ //! `---- //// [38379.js] -var art = require("./ex").art; -var artoo = require("./ex2"); +var art = require('./ex').art; +var artoo = require('./ex2'); var x = 1; art(x); var y = 1; diff --git a/crates/swc/tests/tsc-references/requireAssertsFromTypescript.2.minified.js b/crates/swc/tests/tsc-references/requireAssertsFromTypescript.2.minified.js index 105b70dacbb1..109a1dcf3db6 100644 --- a/crates/swc/tests/tsc-references/requireAssertsFromTypescript.2.minified.js +++ b/crates/swc/tests/tsc-references/requireAssertsFromTypescript.2.minified.js @@ -9,5 +9,5 @@ export { }; //! : ^^^^^^^^^^^^^ //! `---- //// [38379.js] -var art = require("./ex").art, artoo = require("./ex2"); +var art = require('./ex').art, artoo = require('./ex2'); art(1), artoo(1); diff --git a/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess.1.normal.js b/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess.1.normal.js index cee752786d3f..009a29ade60d 100644 --- a/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess.1.normal.js +++ b/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess.1.normal.js @@ -1,6 +1,6 @@ //// [requireOfESWithPropertyAccess.ts] //// [main.js] -var x = require("./ch").x; +var x = require('./ch').x; x; x.grey; x.x.grey; diff --git a/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess.2.minified.js b/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess.2.minified.js index 17ff6f000deb..6915d52f5da0 100644 --- a/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess.2.minified.js +++ b/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess.2.minified.js @@ -1,6 +1,6 @@ //// [requireOfESWithPropertyAccess.ts] //// [main.js] -var x = require("./ch").x; +var x = require('./ch').x; x.grey, x.x.grey; //// [ch.js] var x = { diff --git a/crates/swc/tests/tsc-references/restTuplesFromContextualTypes.1.normal.js b/crates/swc/tests/tsc-references/restTuplesFromContextualTypes.1.normal.js index 3fdc3afac604..08e89009dd42 100644 --- a/crates/swc/tests/tsc-references/restTuplesFromContextualTypes.1.normal.js +++ b/crates/swc/tests/tsc-references/restTuplesFromContextualTypes.1.normal.js @@ -218,7 +218,7 @@ var g8 = pipe(function(x, y) { for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++){ rest[_key] = arguments[_key]; } -})(1, ""); +})(1, ''); take(function() { for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++){ rest[_key] = arguments[_key]; diff --git a/crates/swc/tests/tsc-references/restTuplesFromContextualTypes.2.minified.js b/crates/swc/tests/tsc-references/restTuplesFromContextualTypes.2.minified.js index da587478a7a4..2bd891f73095 100644 --- a/crates/swc/tests/tsc-references/restTuplesFromContextualTypes.2.minified.js +++ b/crates/swc/tests/tsc-references/restTuplesFromContextualTypes.2.minified.js @@ -88,6 +88,6 @@ import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array"; return "" + x; }), (function(a, b) {}).apply(this, _to_consumable_array(tuple)), function() { for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key]; -}(1, ""), take(function() { +}(1, ''), take(function() { for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key]; }); diff --git a/crates/swc/tests/tsc-references/returnStatements.1.normal.js b/crates/swc/tests/tsc-references/returnStatements.1.normal.js index 94d98cfd83d0..7e20dd8cc711 100644 --- a/crates/swc/tests/tsc-references/returnStatements.1.normal.js +++ b/crates/swc/tests/tsc-references/returnStatements.1.normal.js @@ -7,7 +7,7 @@ function fn1() { return 1; } function fn2() { - return ""; + return ''; } function fn3() { return undefined; diff --git a/crates/swc/tests/tsc-references/returnTagTypeGuard.1.normal.js b/crates/swc/tests/tsc-references/returnTagTypeGuard.1.normal.js index a30a41850685..033fa1b80e7a 100644 --- a/crates/swc/tests/tsc-references/returnTagTypeGuard.1.normal.js +++ b/crates/swc/tests/tsc-references/returnTagTypeGuard.1.normal.js @@ -19,7 +19,7 @@ var Group = /*#__PURE__*/ function() { "use strict"; function Group() { _class_call_check(this, Group); - this.d = "no"; + this.d = 'no'; } var _proto = Group.prototype; /** diff --git a/crates/swc/tests/tsc-references/scannerNonAsciiHorizontalWhitespace.1.normal.js b/crates/swc/tests/tsc-references/scannerNonAsciiHorizontalWhitespace.1.normal.js index ad39a99cf630..d55e99005299 100644 --- a/crates/swc/tests/tsc-references/scannerNonAsciiHorizontalWhitespace.1.normal.js +++ b/crates/swc/tests/tsc-references/scannerNonAsciiHorizontalWhitespace.1.normal.js @@ -1,5 +1,5 @@ //// [scannerNonAsciiHorizontalWhitespace.ts] //// [scannerNonAsciiHorizontalWhitespace.ts] -"\xa0 function f() {}"; +"  function f() {}"; //// [scannerNonAsciiHorizontalWhitespace.js] -"\xa0 function f() {}"; +"  function f() {}"; diff --git a/crates/swc/tests/tsc-references/scannerS7.2_A1.5_T2.1.normal.js b/crates/swc/tests/tsc-references/scannerS7.2_A1.5_T2.1.normal.js index 12e72eb405d5..1c0c2881677c 100644 --- a/crates/swc/tests/tsc-references/scannerS7.2_A1.5_T2.1.normal.js +++ b/crates/swc/tests/tsc-references/scannerS7.2_A1.5_T2.1.normal.js @@ -7,12 +7,12 @@ * @path ch07/7.2/S7.2_A1.5_T2.js * @description Insert real NO-BREAK SPACE between tokens of var x=1 */ //CHECK#1 -eval("\xa0var x\xa0= 1\xa0"); +eval("\u00A0var x\u00A0= 1\u00A0"); if (x !== 1) { $ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + x); } //CHECK#2 var x = 1; if (x !== 1) { - $ERROR("#2: \xa0var x\xa0= 1\xa0; x === 1. Actual: " + x); + $ERROR('#2:  var x = 1 ; x === 1. Actual: ' + x); } diff --git a/crates/swc/tests/tsc-references/scannerS7.2_A1.5_T2.2.minified.js b/crates/swc/tests/tsc-references/scannerS7.2_A1.5_T2.2.minified.js index b09ef40b9afc..4a18edce8dc0 100644 --- a/crates/swc/tests/tsc-references/scannerS7.2_A1.5_T2.2.minified.js +++ b/crates/swc/tests/tsc-references/scannerS7.2_A1.5_T2.2.minified.js @@ -1,4 +1,4 @@ //// [scannerS7.2_A1.5_T2.ts] -eval("\xa0var x\xa0= 1\xa0"), 1 !== x && $ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + x); +eval("\u00A0var x\u00A0= 1\u00A0"), 1 !== x && $ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + x); var x = 1; -1 !== x && $ERROR("#2: \xa0var x\xa0= 1\xa0; x === 1. Actual: " + x); +1 !== x && $ERROR('#2:  var x = 1 ; x === 1. Actual: ' + x); diff --git a/crates/swc/tests/tsc-references/scannerS7.3_A1.1_T2.1.normal.js b/crates/swc/tests/tsc-references/scannerS7.3_A1.1_T2.1.normal.js index 9d27b12a0872..b873d9e69f76 100644 --- a/crates/swc/tests/tsc-references/scannerS7.3_A1.1_T2.1.normal.js +++ b/crates/swc/tests/tsc-references/scannerS7.3_A1.1_T2.1.normal.js @@ -9,5 +9,5 @@ */ //CHECK#1 var x = 1; if (x !== 1) { - $ERROR("#1: var\\nx\\n=\\n1\\n; x === 1. Actual: " + x); + $ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + x); } diff --git a/crates/swc/tests/tsc-references/scannerS7.6_A4.2_T1.1.normal.js b/crates/swc/tests/tsc-references/scannerS7.6_A4.2_T1.1.normal.js index a0fd702300c8..7fbb6a71e85c 100644 --- a/crates/swc/tests/tsc-references/scannerS7.6_A4.2_T1.1.normal.js +++ b/crates/swc/tests/tsc-references/scannerS7.6_A4.2_T1.1.normal.js @@ -9,133 +9,133 @@ */ //CHECK#А-Я var А = 1; if (А !== 1) { - $ERROR("#А"); + $ERROR('#А'); } var Б = 1; if (Б !== 1) { - $ERROR("#Б"); + $ERROR('#Б'); } var В = 1; if (В !== 1) { - $ERROR("#В"); + $ERROR('#В'); } var Г = 1; if (Г !== 1) { - $ERROR("#Г"); + $ERROR('#Г'); } var Д = 1; if (Д !== 1) { - $ERROR("#Д"); + $ERROR('#Д'); } var Е = 1; if (Е !== 1) { - $ERROR("#Е"); + $ERROR('#Е'); } var Ж = 1; if (Ж !== 1) { - $ERROR("#Ж"); + $ERROR('#Ж'); } var З = 1; if (З !== 1) { - $ERROR("#З"); + $ERROR('#З'); } var И = 1; if (И !== 1) { - $ERROR("#И"); + $ERROR('#И'); } var Й = 1; if (Й !== 1) { - $ERROR("#Й"); + $ERROR('#Й'); } var К = 1; if (К !== 1) { - $ERROR("#К"); + $ERROR('#К'); } var Л = 1; if (Л !== 1) { - $ERROR("#Л"); + $ERROR('#Л'); } var М = 1; if (М !== 1) { - $ERROR("#М"); + $ERROR('#М'); } var Н = 1; if (Н !== 1) { - $ERROR("#Н"); + $ERROR('#Н'); } var О = 1; if (О !== 1) { - $ERROR("#О"); + $ERROR('#О'); } var П = 1; if (П !== 1) { - $ERROR("#П"); + $ERROR('#П'); } var Р = 1; if (Р !== 1) { - $ERROR("#Р"); + $ERROR('#Р'); } var С = 1; if (С !== 1) { - $ERROR("#С"); + $ERROR('#С'); } var Т = 1; if (Т !== 1) { - $ERROR("#Т"); + $ERROR('#Т'); } var У = 1; if (У !== 1) { - $ERROR("#У"); + $ERROR('#У'); } var Ф = 1; if (Ф !== 1) { - $ERROR("#Ф"); + $ERROR('#Ф'); } var Х = 1; if (Х !== 1) { - $ERROR("#Х"); + $ERROR('#Х'); } var Ц = 1; if (Ц !== 1) { - $ERROR("#Ц"); + $ERROR('#Ц'); } var Ч = 1; if (Ч !== 1) { - $ERROR("#Ч"); + $ERROR('#Ч'); } var Ш = 1; if (Ш !== 1) { - $ERROR("#Ш"); + $ERROR('#Ш'); } var Щ = 1; if (Щ !== 1) { - $ERROR("#Щ"); + $ERROR('#Щ'); } var Ъ = 1; if (Ъ !== 1) { - $ERROR("#Ъ"); + $ERROR('#Ъ'); } var Ы = 1; if (Ы !== 1) { - $ERROR("#Ы"); + $ERROR('#Ы'); } var Ь = 1; if (Ь !== 1) { - $ERROR("#Ь"); + $ERROR('#Ь'); } var Э = 1; if (Э !== 1) { - $ERROR("#Э"); + $ERROR('#Э'); } var Ю = 1; if (Ю !== 1) { - $ERROR("#Ю"); + $ERROR('#Ю'); } var Я = 1; if (Я !== 1) { - $ERROR("#Я"); + $ERROR('#Я'); } var Ё = 1; if (Ё !== 1) { - $ERROR("#Ё"); + $ERROR('#Ё'); } diff --git a/crates/swc/tests/tsc-references/scannerStringLiteralWithContainingNullCharacter1.1.normal.js b/crates/swc/tests/tsc-references/scannerStringLiteralWithContainingNullCharacter1.1.normal.js index 6f3b4f8f86d26cbe478acbc71b4af3a881d8a7f8..25eb484f41d8a3bd4ce9acf77f381a4aa864f9be 100644 GIT binary patch delta 10 RcmZ>EnqbSyprB;U1po}G0p9=s delta 11 ScmZ>Ao?y!sW1yg9%>@7v9|CLu diff --git a/crates/swc/tests/tsc-references/spellingUncheckedJS.1.normal.js b/crates/swc/tests/tsc-references/spellingUncheckedJS.1.normal.js index 6877b6aabfa4..a9f4959f979e 100644 --- a/crates/swc/tests/tsc-references/spellingUncheckedJS.1.normal.js +++ b/crates/swc/tests/tsc-references/spellingUncheckedJS.1.normal.js @@ -18,7 +18,7 @@ var Classe = /*#__PURE__*/ function() { "use strict"; function Classe() { _class_call_check(this, Classe); - this.non = "oui"; + this.non = 'oui'; } var _proto = Classe.prototype; _proto.methode = function methode() { @@ -57,7 +57,7 @@ new Date().getGMTDate() // OK, from another file ; // No suggestions for globals from other files var atoc = setIntegral(function() { - return console.log("ok"); + return console.log('ok'); }, 500); AudioBuffin // etc ; diff --git a/crates/swc/tests/tsc-references/spellingUncheckedJS.2.minified.js b/crates/swc/tests/tsc-references/spellingUncheckedJS.2.minified.js index d9b7baf71722..5ca6ff910f37 100644 --- a/crates/swc/tests/tsc-references/spellingUncheckedJS.2.minified.js +++ b/crates/swc/tests/tsc-references/spellingUncheckedJS.2.minified.js @@ -10,7 +10,7 @@ var object = { spaaace: 3 }; object.spaaaace, object.spaace = 12, object.fresh = 12, other.puuuce, new Date().getGMTDate(), setIntegral(function() { - return console.log("ok"); + return console.log('ok'); }, 500), AudioBuffin, Jimmy, Jon; //// [other.js] Jon; diff --git a/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict.1.normal.js b/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict.1.normal.js index 3cce4f0f7d63..706dd151ae88 100644 --- a/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict.1.normal.js +++ b/crates/swc/tests/tsc-references/spreadOverwritesPropertyStrict.1.normal.js @@ -61,13 +61,13 @@ function k(t) { } function l(anyrequired) { return _object_spread({ - a: "zzz" + a: 'zzz' }, anyrequired) // error ; } function m(anyoptional) { return _object_spread({ - a: "zzz" + a: 'zzz' }, anyoptional) // ok ; } diff --git a/crates/swc/tests/tsc-references/staticPropertyNotInClassType.1.normal.js b/crates/swc/tests/tsc-references/staticPropertyNotInClassType.1.normal.js index 9b3668981fde..230fa316ccb9 100644 --- a/crates/swc/tests/tsc-references/staticPropertyNotInClassType.1.normal.js +++ b/crates/swc/tests/tsc-references/staticPropertyNotInClassType.1.normal.js @@ -26,7 +26,7 @@ var NonGeneric; return C; }(); (function(C) { - C.bar = ""; // not reflected in class type + C.bar = ''; // not reflected in class type })(C || (C = {})); var c = new C(1, 2); var r = c.fn(); @@ -59,9 +59,9 @@ var Generic; return C; }(); (function(C) { - C.bar = ""; // not reflected in class type + C.bar = ''; // not reflected in class type })(C || (C = {})); - var c = new C(1, ""); + var c = new C(1, ''); var r = c.fn(); var r4 = c.foo; // error var r5 = c.bar; // error diff --git a/crates/swc/tests/tsc-references/staticPropertyNotInClassType.2.minified.js b/crates/swc/tests/tsc-references/staticPropertyNotInClassType.2.minified.js index 41d71ae1ff13..7cf02c5f80e4 100644 --- a/crates/swc/tests/tsc-references/staticPropertyNotInClassType.2.minified.js +++ b/crates/swc/tests/tsc-references/staticPropertyNotInClassType.2.minified.js @@ -17,7 +17,7 @@ NonGeneric || (NonGeneric = {}), ((C = function() { set: function(v) {} } ]), C; -}()) || (C = {})).bar = "", (c = new C(1, 2)).fn(), c.foo, c.bar, c.x, Generic || (Generic = {}), ((C1 = function() { +}()) || (C = {})).bar = '', (c = new C(1, 2)).fn(), c.foo, c.bar, c.x, Generic || (Generic = {}), ((C1 = function() { function C(a, b) { _class_call_check(this, C), this.a = a, this.b = b; } @@ -32,4 +32,4 @@ NonGeneric || (NonGeneric = {}), ((C = function() { set: function(v) {} } ]), C; -}()) || (C1 = {})).bar = "", (c1 = new C1(1, "")).fn(), c1.foo, c1.bar, c1.x; +}()) || (C1 = {})).bar = '', (c1 = new C1(1, '')).fn(), c1.foo, c1.bar, c1.x; diff --git a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations.1.normal.js b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations.1.normal.js index 629472493e7a..eac909e07e9e 100644 --- a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations.1.normal.js +++ b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations.1.normal.js @@ -9,7 +9,7 @@ var C = /*#__PURE__*/ function() { } var _proto = C.prototype; _proto.foo = function foo() { - return ""; + return ''; }; C.foo = function foo() {} // ok ; @@ -17,7 +17,7 @@ var C = /*#__PURE__*/ function() { { key: "X", get: function get() { - return ""; + return ''; }, set: function set(v1) {} // ok } @@ -34,21 +34,21 @@ var C = /*#__PURE__*/ function() { var a; // error var b = { - a: "", + a: '', b: 1, c: function() {}, - "d": "", + "d": '', "e": 1, - 1.0: "", + 1.0: '', 2.0: 1, - "3.0": "", + "3.0": '', "4.0": 1, f: null, get X () { - return ""; + return ''; }, set X (v){}, foo: function foo() { - return ""; + return ''; } }; diff --git a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2.1.normal.js b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2.1.normal.js index 3845a5ee0f85..7691015cc872 100644 --- a/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2.1.normal.js +++ b/crates/swc/tests/tsc-references/stringIndexerConstrainsPropertyDeclarations2.1.normal.js @@ -10,7 +10,7 @@ var A = /*#__PURE__*/ function() { } var _proto = A.prototype; _proto.foo = function foo() { - return ""; + return ''; }; return A; }(); @@ -24,7 +24,7 @@ var B = /*#__PURE__*/ function(A) { } var _proto = B.prototype; _proto.bar = function bar() { - return ""; + return ''; }; return B; }(A); diff --git a/crates/swc/tests/tsc-references/stringIndexingResults.1.normal.js b/crates/swc/tests/tsc-references/stringIndexingResults.1.normal.js index bf0a675634df..8d7a5656fda3 100644 --- a/crates/swc/tests/tsc-references/stringIndexingResults.1.normal.js +++ b/crates/swc/tests/tsc-references/stringIndexingResults.1.normal.js @@ -3,23 +3,23 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var C = function C() { "use strict"; _class_call_check(this, C); - this.y = ""; + this.y = ''; }; var c; -var r1 = c["y"]; -var r2 = c["a"]; +var r1 = c['y']; +var r2 = c['a']; var r3 = c[1]; var i; -var r4 = i["y"]; -var r5 = i["a"]; +var r4 = i['y']; +var r5 = i['a']; var r6 = i[1]; var a; -var r7 = a["y"]; -var r8 = a["a"]; +var r7 = a['y']; +var r8 = a['a']; var r9 = a[1]; var b = { - y: "" + y: '' }; -var r10 = b["y"]; -var r11 = b["a"]; +var r10 = b['y']; +var r11 = b['a']; var r12 = b[1]; diff --git a/crates/swc/tests/tsc-references/stringIndexingResults.2.minified.js b/crates/swc/tests/tsc-references/stringIndexingResults.2.minified.js index c206b42d58ac..885149ae844d 100644 --- a/crates/swc/tests/tsc-references/stringIndexingResults.2.minified.js +++ b/crates/swc/tests/tsc-references/stringIndexingResults.2.minified.js @@ -2,6 +2,6 @@ import "@swc/helpers/_/_class_call_check"; c.y, c.a, c[1], i.y, i.a, i[1], a.y, a.a, a[1]; var c, i, a, b = { - y: "" + y: '' }; b.y, b.a, b[1]; diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesAndTuples01.1.normal.js b/crates/swc/tests/tsc-references/stringLiteralTypesAndTuples01.1.normal.js index c6d64af300b9..88958bf254fd 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesAndTuples01.1.normal.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesAndTuples01.1.normal.js @@ -1,7 +1,7 @@ //// [stringLiteralTypesAndTuples01.ts] // Should all be strings. var hello = "Hello", brave = "Brave", newish = "New", world = "World"; -var im = "I'm", a = "a", dinosaur = "t-rex"; +var im = 'I\'m', a = 'a', dinosaur = 't-rex'; rawr(dinosaur); function rawr(dino) { if (dino === "t-rex") { diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesAndTuples01.2.minified.js b/crates/swc/tests/tsc-references/stringLiteralTypesAndTuples01.2.minified.js index 6bf7c937293b..6d0eea0952ac 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesAndTuples01.2.minified.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesAndTuples01.2.minified.js @@ -1,4 +1,4 @@ //// [stringLiteralTypesAndTuples01.ts] !function(dino) { if ("t-rex" !== dino && "raptor" !== dino) throw "Unexpected " + dino; -}("t-rex"); +}('t-rex'); diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01.1.normal.js b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01.1.normal.js index a5bd0dace193..03bc2c868bce 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01.1.normal.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01.1.normal.js @@ -15,7 +15,7 @@ function getFalsyPrimitive(x) { var Consts1; (function(Consts1) { var EMPTY_STRING = getFalsyPrimitive("string"); - var ZERO = getFalsyPrimitive("number"); + var ZERO = getFalsyPrimitive('number'); var FALSE = getFalsyPrimitive("boolean"); })(Consts1 || (Consts1 = {})); var string = "string"; diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01.2.minified.js b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01.2.minified.js index fa42b1517324..aa202c314408 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01.2.minified.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads01.2.minified.js @@ -5,6 +5,6 @@ function getFalsyPrimitive(x) { if ("boolean" === x) return !1; throw "Invalid value"; } -Consts1 || (Consts1 = {}), getFalsyPrimitive("string"), getFalsyPrimitive("number"), getFalsyPrimitive("boolean"); +Consts1 || (Consts1 = {}), getFalsyPrimitive("string"), getFalsyPrimitive('number'), getFalsyPrimitive("boolean"); var Consts1, Consts2, string = "string", number = "number", boolean = "boolean", stringOrNumber = string || number, stringOrBoolean = string || boolean, booleanOrNumber = number || boolean, stringOrBooleanOrNumber = stringOrBoolean || number; Consts2 || (Consts2 = {}), getFalsyPrimitive(string), getFalsyPrimitive(number), getFalsyPrimitive(boolean), getFalsyPrimitive(stringOrNumber), getFalsyPrimitive(stringOrBoolean), getFalsyPrimitive(booleanOrNumber), getFalsyPrimitive(stringOrBooleanOrNumber); diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02.1.normal.js b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02.1.normal.js index a4203ceecd9b..ffe81faeac0f 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02.1.normal.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02.1.normal.js @@ -15,7 +15,7 @@ function getFalsyPrimitive(x) { var Consts1; (function(Consts1) { var EMPTY_STRING = getFalsyPrimitive("string"); - var ZERO = getFalsyPrimitive("number"); + var ZERO = getFalsyPrimitive('number'); var FALSE = getFalsyPrimitive("boolean"); })(Consts1 || (Consts1 = {})); var string = "string"; diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02.2.minified.js b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02.2.minified.js index 826f7bbd0f51..43a2cfce27ee 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02.2.minified.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesOverloads02.2.minified.js @@ -5,6 +5,6 @@ function getFalsyPrimitive(x) { if ("boolean" === x) return !1; throw "Invalid value"; } -Consts1 || (Consts1 = {}), getFalsyPrimitive("string"), getFalsyPrimitive("number"), getFalsyPrimitive("boolean"); +Consts1 || (Consts1 = {}), getFalsyPrimitive("string"), getFalsyPrimitive('number'), getFalsyPrimitive("boolean"); var Consts1, Consts2, string = "string", number = "number", boolean = "boolean", stringOrNumber = string || number, stringOrBoolean = string || boolean, booleanOrNumber = number || boolean, stringOrBooleanOrNumber = stringOrBoolean || number; Consts2 || (Consts2 = {}), getFalsyPrimitive(string), getFalsyPrimitive(number), getFalsyPrimitive(boolean), getFalsyPrimitive(stringOrNumber), getFalsyPrimitive(stringOrBoolean), getFalsyPrimitive(booleanOrNumber), getFalsyPrimitive(stringOrBooleanOrNumber); diff --git a/crates/swc/tests/tsc-references/stringNamedPropertyAccess.1.normal.js b/crates/swc/tests/tsc-references/stringNamedPropertyAccess.1.normal.js index d24ecfafb7d2..1bff0bb832f7 100644 --- a/crates/swc/tests/tsc-references/stringNamedPropertyAccess.1.normal.js +++ b/crates/swc/tests/tsc-references/stringNamedPropertyAccess.1.normal.js @@ -6,7 +6,7 @@ var C = function C() { }; var c; var r1 = c["a b"]; -var r1b = C["c d"]; +var r1b = C['c d']; var i; var r2 = i["a b"]; var a; diff --git a/crates/swc/tests/tsc-references/stringPropertyAccess.1.normal.js b/crates/swc/tests/tsc-references/stringPropertyAccess.1.normal.js index 4dd4b7a87043..a2ae016b5bf9 100644 --- a/crates/swc/tests/tsc-references/stringPropertyAccess.1.normal.js +++ b/crates/swc/tests/tsc-references/stringPropertyAccess.1.normal.js @@ -1,6 +1,6 @@ //// [stringPropertyAccess.ts] -var x = ""; +var x = ''; var a = x.charAt(0); -var b = x.hasOwnProperty("charAt"); -var c = x["charAt"](0); -var e = x["hasOwnProperty"]("toFixed"); +var b = x.hasOwnProperty('charAt'); +var c = x['charAt'](0); +var e = x['hasOwnProperty']('toFixed'); diff --git a/crates/swc/tests/tsc-references/stringPropertyAccess.2.minified.js b/crates/swc/tests/tsc-references/stringPropertyAccess.2.minified.js index 0e145dc5f5fc..1c7f2b658a70 100644 --- a/crates/swc/tests/tsc-references/stringPropertyAccess.2.minified.js +++ b/crates/swc/tests/tsc-references/stringPropertyAccess.2.minified.js @@ -1,2 +1,2 @@ //// [stringPropertyAccess.ts] -"".hasOwnProperty("charAt"), "".hasOwnProperty("toFixed"); +''.hasOwnProperty('charAt'), ''.hasOwnProperty('toFixed'); diff --git a/crates/swc/tests/tsc-references/stringPropertyAccessWithError.1.normal.js b/crates/swc/tests/tsc-references/stringPropertyAccessWithError.1.normal.js index 66f40ee80733..8014ffe1bc76 100644 --- a/crates/swc/tests/tsc-references/stringPropertyAccessWithError.1.normal.js +++ b/crates/swc/tests/tsc-references/stringPropertyAccessWithError.1.normal.js @@ -1,3 +1,3 @@ //// [stringPropertyAccessWithError.ts] -var x = ""; -var d = x["charAt"]("invalid"); // error +var x = ''; +var d = x['charAt']('invalid'); // error diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameter.1.normal.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameter.1.normal.js index c778d82489c3..897955577aee 100644 --- a/crates/swc/tests/tsc-references/subtypesOfTypeParameter.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameter.1.normal.js @@ -53,8 +53,8 @@ function f2(x, y) { var r0b = true ? x : u; var r1 = true ? 1 : x; var r1 = true ? x : 1; - var r2 = true ? "" : x; - var r2 = true ? x : ""; + var r2 = true ? '' : x; + var r2 = true ? x : ''; var r3 = true ? true : x; var r3 = true ? x : true; var r4 = true ? new Date() : x; diff --git a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2.1.normal.js b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2.1.normal.js index e05e28b15ca7..4f2e0144c703 100644 --- a/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypesOfTypeParameterWithConstraints2.1.normal.js @@ -62,8 +62,8 @@ function f5(x) { var r1 = true ? x : 1; // ok } function f6(x) { - var r2 = true ? "" : x; // ok - var r2 = true ? x : ""; // ok + var r2 = true ? '' : x; // ok + var r2 = true ? x : ''; // ok } function f7(x) { var r3 = true ? true : x; // ok diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures.1.normal.js index baaac712f83d..6fafd5c1d7a6 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures.1.normal.js @@ -5,12 +5,12 @@ var CallSignature; return 1; }); // ok because base returns void var r2 = foo1(function(x) { - return ""; + return ''; }); // ok because base returns void var r3 = foo2(function(x, y) { return 1; }); // ok because base returns void var r4 = foo2(function(x) { - return ""; + return ''; }); // ok because base returns void })(CallSignature || (CallSignature = {})); diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures.2.minified.js index 76c480fe19e4..96d528bde1df 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures.2.minified.js @@ -3,9 +3,9 @@ var CallSignature; CallSignature || (CallSignature = {}), foo1(function(x) { return 1; }), foo1(function(x) { - return ""; + return ''; }), foo2(function(x, y) { return 1; }), foo2(function(x) { - return ""; + return ''; }); diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures2.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures2.1.normal.js index 46df5963414e..dc8088f62247 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures2.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures2.1.normal.js @@ -58,12 +58,12 @@ var r1b = [ ]; // generic signature, subtype in both directions var r2arg1 = function(x) { return [ - "" + '' ]; }; var r2arg2 = function(x) { return [ - "" + '' ]; }; var r2 = foo2(r2arg1); @@ -92,7 +92,7 @@ var r4arg1 = function(x, y) { return x; }; var r4arg2 = function(x, y) { - return ""; + return ''; }; var r4 = foo4(r4arg1); // any var r4a = [ @@ -107,7 +107,7 @@ var r5arg1 = function(x) { return null; }; var r5arg2 = function(x) { - return ""; + return ''; }; var r5 = foo5(r5arg1); // any var r5a = [ diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures2.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures2.2.minified.js index fe4963fb842e..3be0ba3f9060 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures2.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures2.2.minified.js @@ -8,7 +8,7 @@ foo1(function(x) { ]; }), foo2(function(x) { return [ - "" + '' ]; }), foo3(function(x) { return x; diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures3.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures3.1.normal.js index eb7206b6325e..ac5d0e23ef00 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures3.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures3.1.normal.js @@ -46,7 +46,7 @@ var Errors; var r1a = [ function(x) { return [ - "" + '' ]; }, function(x) { @@ -59,7 +59,7 @@ var Errors; }, function(x) { return [ - "" + '' ]; } ]; @@ -192,7 +192,7 @@ var WithGenericSignaturesInBaseType; (function(WithGenericSignaturesInBaseType) { var r2arg2 = function(x) { return [ - "" + '' ]; }; var r2 = foo2(r2arg2); // (x:T) => T[] since we can infer from generic signatures now diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures3.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures3.2.minified.js index 0f3db3952e81..fd3bd7bf3028 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures3.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures3.2.minified.js @@ -30,7 +30,7 @@ Errors || (Errors = {}), foo2(function(x) { return null; }), WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {}), foo2(function(x) { return [ - "" + '' ]; }), foo3(function(x) { return null; diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures4.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures4.1.normal.js index 907b70250711..f331d197ca7b 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures4.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures4.1.normal.js @@ -54,12 +54,12 @@ var r1b = [ ]; var r2arg = function(x) { return [ - "" + '' ]; }; var r2arg2 = function(x) { return [ - "" + '' ]; }; var r2 = foo2(r2arg); @@ -85,10 +85,10 @@ var r3b = [ r3arg ]; var r4arg = function(x, y) { - return ""; + return ''; }; var r4arg2 = function(x, y) { - return ""; + return ''; }; var r4 = foo4(r4arg); var r4a = [ diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignatures4.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithCallSignatures4.2.minified.js index 4e8fe8078576..7eac2118c58c 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignatures4.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignatures4.2.minified.js @@ -6,12 +6,12 @@ foo1(function(x) { return null; }), foo2(function(x) { return [ - "" + '' ]; }), foo3(function(x) { return null; }), foo4(function(x, y) { - return ""; + return ''; }), foo5(function(x) { return null; }), foo6(function(x) { diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignaturesA.1.normal.js b/crates/swc/tests/tsc-references/subtypingWithCallSignaturesA.1.normal.js index 83cdcd313dc1..92fe66e5551c 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignaturesA.1.normal.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignaturesA.1.normal.js @@ -1,4 +1,4 @@ //// [subtypingWithCallSignaturesA.ts] var r5 = foo3(function(x) { - return ""; + return ''; }); // error diff --git a/crates/swc/tests/tsc-references/subtypingWithCallSignaturesA.2.minified.js b/crates/swc/tests/tsc-references/subtypingWithCallSignaturesA.2.minified.js index 03e5775fa623..809c0b06f83f 100644 --- a/crates/swc/tests/tsc-references/subtypingWithCallSignaturesA.2.minified.js +++ b/crates/swc/tests/tsc-references/subtypingWithCallSignaturesA.2.minified.js @@ -1,4 +1,4 @@ //// [subtypingWithCallSignaturesA.ts] foo3(function(x) { - return ""; + return ''; }); diff --git a/crates/swc/tests/tsc-references/superCalls.1.normal.js b/crates/swc/tests/tsc-references/superCalls.1.normal.js index c6694b38316c..0eef0d50c9cb 100644 --- a/crates/swc/tests/tsc-references/superCalls.1.normal.js +++ b/crates/swc/tests/tsc-references/superCalls.1.normal.js @@ -15,11 +15,11 @@ var Derived = /*#__PURE__*/ function(Base) { function Derived(q) { _class_call_check(this, Derived); var _this; - _this = _super.call(this, ""); + _this = _super.call(this, ''); _this.q = q; var _temp; //type of super call expression is void - var p = (_temp = _this = _super.call(this, ""), _this.q = q, _temp); + var p = (_temp = _this = _super.call(this, ''), _this.q = q, _temp); var p = v(); return _this; } @@ -35,7 +35,7 @@ var OtherDerived = /*#__PURE__*/ function(OtherBase) { var _super = _create_super(OtherDerived); function OtherDerived() { _class_call_check(this, OtherDerived); - var p = ""; + var p = ''; return _super.call(this); } return OtherDerived; diff --git a/crates/swc/tests/tsc-references/superPropertyAccessNoError.1.normal.js b/crates/swc/tests/tsc-references/superPropertyAccessNoError.1.normal.js index 9c06ef9123bc..ccf16688782f 100644 --- a/crates/swc/tests/tsc-references/superPropertyAccessNoError.1.normal.js +++ b/crates/swc/tests/tsc-references/superPropertyAccessNoError.1.normal.js @@ -19,7 +19,7 @@ var SomeBaseClass = /*#__PURE__*/ function() { } var _proto = SomeBaseClass.prototype; _proto.func = function func() { - return ""; + return ''; }; _proto.returnThis = function returnThis() { return this; diff --git a/crates/swc/tests/tsc-references/superPropertyAccessNoError.2.minified.js b/crates/swc/tests/tsc-references/superPropertyAccessNoError.2.minified.js index c5d6e9fb5537..a6e086644f00 100644 --- a/crates/swc/tests/tsc-references/superPropertyAccessNoError.2.minified.js +++ b/crates/swc/tests/tsc-references/superPropertyAccessNoError.2.minified.js @@ -48,7 +48,7 @@ new (function(SomeBaseClass) { } var _proto = SomeBaseClass.prototype; return _proto.func = function() { - return ""; + return ''; }, _proto.returnThis = function() { return this; }, SomeBaseClass.func = function() { diff --git a/crates/swc/tests/tsc-references/switchBreakStatements.1.normal.js b/crates/swc/tests/tsc-references/switchBreakStatements.1.normal.js index 65ffc36bea5a..b6e89fb3be85 100644 --- a/crates/swc/tests/tsc-references/switchBreakStatements.1.normal.js +++ b/crates/swc/tests/tsc-references/switchBreakStatements.1.normal.js @@ -1,39 +1,39 @@ //// [switchBreakStatements.ts] -switch(""){ - case "a": +switch(''){ + case 'a': break; } -ONE: switch(""){ - case "a": +ONE: switch(''){ + case 'a': break ONE; } -TWO: THREE: switch(""){ - case "a": +TWO: THREE: switch(''){ + case 'a': break THREE; } -FOUR: switch(""){ - case "a": - FIVE: switch(""){ - case "a": +FOUR: switch(''){ + case 'a': + FIVE: switch(''){ + case 'a': break FOUR; } } -switch(""){ - case "a": - SIX: switch(""){ - case "a": +switch(''){ + case 'a': + SIX: switch(''){ + case 'a': break SIX; } } -SEVEN: switch(""){ - case "a": - switch(""){ - case "a": - switch(""){ - case "a": +SEVEN: switch(''){ + case 'a': + switch(''){ + case 'a': + switch(''){ + case 'a': break SEVEN; - EIGHT: switch(""){ - case "a": + EIGHT: switch(''){ + case 'a': var fn = function fn() {}; break EIGHT; } diff --git a/crates/swc/tests/tsc-references/switchStatements.1.normal.js b/crates/swc/tests/tsc-references/switchStatements.1.normal.js index ead8fdaad77a..4d453ed2b519 100644 --- a/crates/swc/tests/tsc-references/switchStatements.1.normal.js +++ b/crates/swc/tests/tsc-references/switchStatements.1.normal.js @@ -6,13 +6,13 @@ import { _ as _create_super } from "@swc/helpers/_/_create_super"; var M; (function(M) { function fn(x) { - return ""; + return ''; } M.fn = fn; })(M || (M = {})); var x; switch(x){ - case "": + case '': case 12: case true: case null: @@ -26,16 +26,16 @@ switch(x){ id: 12 }: case [ - "a" + 'a' ]: case typeof x === "undefined" ? "undefined" : _type_of(x): case typeof M === "undefined" ? "undefined" : _type_of(M): case M.fn(1): case function(x) { - return ""; + return ''; }: case function(x) { - return ""; + return ''; }(2): default: } @@ -58,11 +58,11 @@ switch(new C()){ case new D(): case { id: 12, - name: "" + name: '' }: case new C(): } -switch(""){ +switch(''){ } switch(12){ } @@ -87,14 +87,14 @@ switch({ }){ } switch([ - "a" + 'a' ]){ } switch(function(x) { - return ""; + return ''; }){ } switch(function(x) { - return ""; + return ''; }(1)){ } diff --git a/crates/swc/tests/tsc-references/switchStatements.2.minified.js b/crates/swc/tests/tsc-references/switchStatements.2.minified.js index 1529c3c0e161..fadae0d7d835 100644 --- a/crates/swc/tests/tsc-references/switchStatements.2.minified.js +++ b/crates/swc/tests/tsc-references/switchStatements.2.minified.js @@ -4,9 +4,9 @@ import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _type_of } from "@swc/helpers/_/_type_of"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; switch((M || (M = {})).fn = function(x) { - return ""; + return ''; }, x){ - case "": + case '': case 12: case !0: case null: @@ -20,7 +20,7 @@ switch((M || (M = {})).fn = function(x) { id: 12 }: case [ - "a" + 'a' ]: case void 0 === x ? "undefined" : _type_of(x): case void 0 === M ? "undefined" : _type_of(M): @@ -41,7 +41,7 @@ switch(new C()){ case new D(): case { id: 12, - name: "" + name: '' }: case new C(): } diff --git a/crates/swc/tests/tsc-references/switchWithConstrainedTypeVariable.1.normal.js b/crates/swc/tests/tsc-references/switchWithConstrainedTypeVariable.1.normal.js index 1d1197e59f5e..2181c121c9e3 100644 --- a/crates/swc/tests/tsc-references/switchWithConstrainedTypeVariable.1.normal.js +++ b/crates/swc/tests/tsc-references/switchWithConstrainedTypeVariable.1.normal.js @@ -2,7 +2,7 @@ // Repro from #20840 function function1(key) { switch(key){ - case "a": + case 'a': key.toLowerCase(); break; default: diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference.1.normal.js index e5a60b374f59..a84081b66df4 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference.1.normal.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference.1.normal.js @@ -331,7 +331,7 @@ someGenerics2b(_templateObject5(), function(n, x) { // Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter function someGenerics3(strs, producer) {} someGenerics3(_templateObject6(), function() { - return ""; + return ''; }); someGenerics3(_templateObject7(), function() { return undefined; @@ -344,7 +344,7 @@ function someGenerics4(strs, n, f) {} someGenerics4(_templateObject9(), 4, function() { return null; }); -someGenerics4(_templateObject10(), "", function() { +someGenerics4(_templateObject10(), '', function() { return 3; }); someGenerics4(_templateObject11(), null, null); @@ -353,7 +353,7 @@ function someGenerics5(strs, n, f) {} someGenerics5(_templateObject12(), 4, function() { return null; }); -someGenerics5(_templateObject13(), "", function() { +someGenerics5(_templateObject13(), '', function() { return 3; }); someGenerics5(_templateObject14(), null, null); @@ -413,14 +413,14 @@ x(_templateObject22(), null, null, null); function someGenerics9(strs, a, b, c) { return null; } -var a9a = someGenerics9(_templateObject23(), "", 0, []); +var a9a = someGenerics9(_templateObject23(), '', 0, []); var a9a; var a9e = someGenerics9(_templateObject24(), undefined, { x: 6, z: new Date() }, { x: 6, - y: "" + y: '' }); var a9e; // Generic tag with multiple parameters of generic type passed arguments with a single best common type diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3.1.normal.js index f91899c5aa46..ebb75280a2aa 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3.1.normal.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3.1.normal.js @@ -253,28 +253,28 @@ var d2 = fn2(_templateObject3(), 0, undefined); // any d1.foo(); // error d2(); // no error (typed as any) // Generic and non-generic overload where generic overload is the only candidate -fn2(_templateObject4(), 0, ""); // OK +fn2(_templateObject4(), 0, ''); // OK // Generic and non-generic overload where non-generic overload is the only candidate -fn2(_templateObject5(), "", 0); // OK +fn2(_templateObject5(), '', 0); // OK function fn3() { return null; } var s = fn3(_templateObject6(), 3); -var s = fn3(_templateObject7(), "", 3, ""); +var s = fn3(_templateObject7(), '', 3, ''); var n = fn3(_templateObject8(), 5, 5, 5); var n; // Generic overloads with differing arity tagging with arguments matching each overload type parameter count var s = fn3(_templateObject9(), 4); -var s = fn3(_templateObject10(), "", "", ""); -var n = fn3(_templateObject11(), "", "", 3); +var s = fn3(_templateObject10(), '', '', ''); +var n = fn3(_templateObject11(), '', '', 3); // Generic overloads with differing arity tagging with argument count that doesn't match any overload fn3(_templateObject12()); // Error function fn4() {} // Generic overloads with constraints tagged with types that satisfy the constraints -fn4(_templateObject13(), "", 3); -fn4(_templateObject14(), 3, ""); +fn4(_templateObject13(), '', 3); +fn4(_templateObject14(), 3, ''); fn4(_templateObject15(), 3, undefined); -fn4(_templateObject16(), "", null); +fn4(_templateObject16(), '', null); // Generic overloads with constraints called with type arguments that do not satisfy the constraints fn4(_templateObject17(), null, null); // Error // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints diff --git a/crates/swc/tests/tsc-references/templateLiteralTypes2.1.normal.js b/crates/swc/tests/tsc-references/templateLiteralTypes2.1.normal.js index 1d58a339078f..95967ff8a809 100644 --- a/crates/swc/tests/tsc-references/templateLiteralTypes2.1.normal.js +++ b/crates/swc/tests/tsc-references/templateLiteralTypes2.1.normal.js @@ -48,9 +48,9 @@ function ft12(s) { } function ft13(s, cond) { var x1 = widening("foo".concat(s)); - var x2 = widening(cond ? "a" : "foo".concat(s)); + var x2 = widening(cond ? 'a' : "foo".concat(s)); var y1 = nonWidening("foo".concat(s)); - var y2 = nonWidening(cond ? "a" : "foo".concat(s)); + var y2 = nonWidening(cond ? 'a' : "foo".concat(s)); } function ft14(t) { var x1 = t; diff --git a/crates/swc/tests/tsc-references/templateLiteralTypes3.1.normal.js b/crates/swc/tests/tsc-references/templateLiteralTypes3.1.normal.js index 711f8fadba9a..2363f10d72aa 100644 --- a/crates/swc/tests/tsc-references/templateLiteralTypes3.1.normal.js +++ b/crates/swc/tests/tsc-references/templateLiteralTypes3.1.normal.js @@ -1,9 +1,9 @@ //// [templateLiteralTypes3.ts] // Inference from template literal type to template literal type function f1(s, n, b, t) { - var x1 = foo1("hello"); // Error - var x2 = foo1("*hello*"); - var x3 = foo1("**hello**"); + var x1 = foo1('hello'); // Error + var x2 = foo1('*hello*'); + var x3 = foo1('**hello**'); var x4 = foo1("*".concat(s, "*")); var x5 = foo1("*".concat(n, "*")); var x6 = foo1("*".concat(b, "*")); @@ -12,20 +12,20 @@ function f1(s, n, b, t) { } function f2() { var x; - x = "1.1.1"; - x = "1.1.1"; - x = "1.1.1"; - x = "1.1.1"; - x = "1.1.1"; - x = "1.1.1"; - x = "1.1.1"; - x = "1.1.1"; + x = '1.1.1'; + x = '1.1.1'; + x = '1.1.1'; + x = '1.1.1'; + x = '1.1.1'; + x = '1.1.1'; + x = '1.1.1'; + x = '1.1.1'; } function f3(s, n, b, t) { var x; - x = "hello"; // Error - x = "*hello*"; - x = "**hello**"; + x = 'hello'; // Error + x = '*hello*'; + x = '**hello**'; x = "*".concat(s, "*"); x = "*".concat(n, "*"); x = "*".concat(b, "*"); @@ -34,9 +34,9 @@ function f3(s, n, b, t) { } function f4(s, n, b, t) { var x; - x = "123"; // Error - x = "*123*"; - x = "**123**"; // Error + x = '123'; // Error + x = '*123*'; + x = '**123**'; // Error x = "*".concat(s, "*"); // Error x = "*".concat(n, "*"); x = "*".concat(b, "*"); // Error @@ -67,15 +67,15 @@ function ff3(x, y) { } } function ff4(x, y) { - if (x === "foo-test") { + if (x === 'foo-test') { x; // 'foo-test' } - if (y === "foo-test") { + if (y === 'foo-test') { y; // 'foo-test' } } function reducer(action) { - if (action.type === "FOO_SUCCESS") { + if (action.type === 'FOO_SUCCESS') { action.type; action.response; } diff --git a/crates/swc/tests/tsc-references/thisPropertyAssignmentInherited.1.normal.js b/crates/swc/tests/tsc-references/thisPropertyAssignmentInherited.1.normal.js index 11c55c1af5ba..2df0ef34bab2 100644 --- a/crates/swc/tests/tsc-references/thisPropertyAssignmentInherited.1.normal.js +++ b/crates/swc/tests/tsc-references/thisPropertyAssignmentInherited.1.normal.js @@ -19,7 +19,7 @@ export var Element = /*#__PURE__*/ function() { get: /** * @returns {String} */ function get() { - return ""; + return ''; }, set: function set(x) {} } diff --git a/crates/swc/tests/tsc-references/thisPropertyAssignmentInherited.2.minified.js b/crates/swc/tests/tsc-references/thisPropertyAssignmentInherited.2.minified.js index c128939093cb..f4430f05544e 100644 --- a/crates/swc/tests/tsc-references/thisPropertyAssignmentInherited.2.minified.js +++ b/crates/swc/tests/tsc-references/thisPropertyAssignmentInherited.2.minified.js @@ -14,7 +14,7 @@ export var Element = function() { { key: "textContent", get: function() { - return ""; + return ''; }, set: function(x) {} } diff --git a/crates/swc/tests/tsc-references/thisTag1.1.normal.js b/crates/swc/tests/tsc-references/thisTag1.1.normal.js index fd50caf5d977..8392f0a3aef7 100644 --- a/crates/swc/tests/tsc-references/thisTag1.1.normal.js +++ b/crates/swc/tests/tsc-references/thisTag1.1.normal.js @@ -9,4 +9,4 @@ var o = { f: f, n: 1 }; -o.f("hi"); +o.f('hi'); diff --git a/crates/swc/tests/tsc-references/thisTag1.2.minified.js b/crates/swc/tests/tsc-references/thisTag1.2.minified.js index 95fe3563c43f..531eca1fb9ac 100644 --- a/crates/swc/tests/tsc-references/thisTag1.2.minified.js +++ b/crates/swc/tests/tsc-references/thisTag1.2.minified.js @@ -4,4 +4,4 @@ return this.n + s.length; }, n: 1 -}).f("hi"); +}).f('hi'); diff --git a/crates/swc/tests/tsc-references/thisTypeInTypePredicate.1.normal.js b/crates/swc/tests/tsc-references/thisTypeInTypePredicate.1.normal.js index 879896d80a1e..e02b33499c52 100644 --- a/crates/swc/tests/tsc-references/thisTypeInTypePredicate.1.normal.js +++ b/crates/swc/tests/tsc-references/thisTypeInTypePredicate.1.normal.js @@ -1,4 +1,4 @@ //// [thisTypeInTypePredicate.ts] var numbers = filter(function(x) { - return "number" == typeof x; + return 'number' == typeof x; }); diff --git a/crates/swc/tests/tsc-references/thisTypeInTypePredicate.2.minified.js b/crates/swc/tests/tsc-references/thisTypeInTypePredicate.2.minified.js index 11dd4275245b..b5331d486631 100644 --- a/crates/swc/tests/tsc-references/thisTypeInTypePredicate.2.minified.js +++ b/crates/swc/tests/tsc-references/thisTypeInTypePredicate.2.minified.js @@ -1,4 +1,4 @@ //// [thisTypeInTypePredicate.ts] filter(function(x) { - return "number" == typeof x; + return 'number' == typeof x; }); diff --git a/crates/swc/tests/tsc-references/throwInEnclosingStatements.1.normal.js b/crates/swc/tests/tsc-references/throwInEnclosingStatements.1.normal.js index 4869a2f8b52c..e4a4c2fafc00 100644 --- a/crates/swc/tests/tsc-references/throwInEnclosingStatements.1.normal.js +++ b/crates/swc/tests/tsc-references/throwInEnclosingStatements.1.normal.js @@ -8,7 +8,7 @@ function fn(x) { }); var y; switch(y){ - case "a": + case 'a': throw y; default: throw y; diff --git a/crates/swc/tests/tsc-references/throwStatements.1.normal.js b/crates/swc/tests/tsc-references/throwStatements.1.normal.js index 2872e97a9cbf..ac979bedc15b 100644 --- a/crates/swc/tests/tsc-references/throwStatements.1.normal.js +++ b/crates/swc/tests/tsc-references/throwStatements.1.normal.js @@ -27,7 +27,7 @@ var M; })(M || (M = {})); var aNumber = 9.9; throw aNumber; -var aString = "this is a string"; +var aString = 'this is a string'; throw aString; var aDate = new Date(12); throw aDate; @@ -49,7 +49,7 @@ var anObjectLiteral = { throw anObjectLiteral; var aFunction = F; throw aFunction; -throw aFunction(""); +throw aFunction(''); var aLambda = function(x) { return 2; }; @@ -70,9 +70,9 @@ throw 0.0; throw false; throw null; throw undefined; -throw "a string"; +throw 'a string'; throw function() { - return "a string"; + return 'a string'; }; throw function(x) { return 42; @@ -83,9 +83,9 @@ throw { }; throw []; throw [ - "a", + 'a', [ - "b" + 'b' ] ]; throw /[a-z]/; diff --git a/crates/swc/tests/tsc-references/ts-expect-error.1.normal.js b/crates/swc/tests/tsc-references/ts-expect-error.1.normal.js index b729ce830424..f28e07887af0 100644 --- a/crates/swc/tests/tsc-references/ts-expect-error.1.normal.js +++ b/crates/swc/tests/tsc-references/ts-expect-error.1.normal.js @@ -1,22 +1,22 @@ //// [ts-expect-error.ts] // @ts-expect-error additional commenting -var invalidCommentedFancySingle = "nope"; +var invalidCommentedFancySingle = 'nope'; /* - @ts-expect-error additional commenting */ var invalidCommentedFancyMulti = "nope"; + @ts-expect-error additional commenting */ var invalidCommentedFancyMulti = 'nope'; // @ts-expect-error additional commenting -var validCommentedFancySingle = "nope"; -/* @ts-expect-error additional commenting */ var validCommentedFancyMulti = "nope"; +var validCommentedFancySingle = 'nope'; +/* @ts-expect-error additional commenting */ var validCommentedFancyMulti = 'nope'; // @ts-expect-error -var invalidCommentedPlainSingle = "nope"; +var invalidCommentedPlainSingle = 'nope'; /* - @ts-expect-error */ var invalidCommentedPlainMulti = "nope"; + @ts-expect-error */ var invalidCommentedPlainMulti = 'nope'; // @ts-expect-error -var validCommentedPlainSingle = "nope"; -/* @ts-expect-error */ var validCommentedPlainMulti1 = "nope"; +var validCommentedPlainSingle = 'nope'; +/* @ts-expect-error */ var validCommentedPlainMulti1 = 'nope'; /* -@ts-expect-error */ var validCommentedPlainMulti2 = "nope"; -var invalidPlain = "nope"; -var validPlain = "nope"; +@ts-expect-error */ var validCommentedPlainMulti2 = 'nope'; +var invalidPlain = 'nope'; +var validPlain = 'nope'; // @ts-expect-error ({ a: true @@ -31,6 +31,6 @@ var validPlain = "nope"; a: true }).a === false; // error // @ts-expect-error: additional commenting with no whitespace -var invalidCommentedFancySingle = "nope"; +var invalidCommentedFancySingle = 'nope'; /* - @ts-expect-error: additional commenting with no whitespace */ var invalidCommentedFancyMulti = "nope"; + @ts-expect-error: additional commenting with no whitespace */ var invalidCommentedFancyMulti = 'nope'; diff --git a/crates/swc/tests/tsc-references/ts-ignore.1.normal.js b/crates/swc/tests/tsc-references/ts-ignore.1.normal.js index 9558d54af5e8..6ec07eb633ad 100644 --- a/crates/swc/tests/tsc-references/ts-ignore.1.normal.js +++ b/crates/swc/tests/tsc-references/ts-ignore.1.normal.js @@ -1,15 +1,15 @@ //// [ts-ignore.ts] // @ts-ignore with additional commenting -var invalidCommentedFancy = "nope"; +var invalidCommentedFancy = 'nope'; // @ts-ignore with additional commenting -var validCommentedFancy = "nope"; +var validCommentedFancy = 'nope'; // @ts-ignore -var invalidCommentedPlain = "nope"; +var invalidCommentedPlain = 'nope'; // @ts-ignore -var validCommentedPlain = "nope"; -var invalidPlain = "nope"; -var validPlain = "nope"; +var validCommentedPlain = 'nope'; +var invalidPlain = 'nope'; +var validPlain = 'nope'; // @ts-ignore: with additional commenting -var invalidCommentedFancy = "nope"; +var invalidCommentedFancy = 'nope'; // @ts-ignore: with additional commenting -var validCommentedFancy = "nope"; +var validCommentedFancy = 'nope'; diff --git a/crates/swc/tests/tsc-references/tsNoCheckForTypescriptComments1.1.normal.js b/crates/swc/tests/tsc-references/tsNoCheckForTypescriptComments1.1.normal.js index 9d816da7f835..8005e02e9095 100644 --- a/crates/swc/tests/tsc-references/tsNoCheckForTypescriptComments1.1.normal.js +++ b/crates/swc/tests/tsc-references/tsNoCheckForTypescriptComments1.1.normal.js @@ -5,6 +5,6 @@ export var a = 1 + {}; // This is an error, ofc, `Operator '+' cannot be applied export var Bet = function Bet() { "use strict"; _class_call_check(this, Bet); - this.q = "lol" // And so will this implements error + this.q = 'lol' // And so will this implements error ; }; diff --git a/crates/swc/tests/tsc-references/tsNoCheckForTypescriptComments1.2.minified.js b/crates/swc/tests/tsc-references/tsNoCheckForTypescriptComments1.2.minified.js index 78aa2db56e85..949e40792866 100644 --- a/crates/swc/tests/tsc-references/tsNoCheckForTypescriptComments1.2.minified.js +++ b/crates/swc/tests/tsc-references/tsNoCheckForTypescriptComments1.2.minified.js @@ -2,5 +2,5 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; export var a = 1 + {}; export var Bet = function Bet() { - _class_call_check(this, Bet), this.q = "lol"; + _class_call_check(this, Bet), this.q = 'lol'; }; diff --git a/crates/swc/tests/tsc-references/tsxAttributeErrors.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeErrors.1.normal.js index 172509402d2d..d3c35274c5f1 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeErrors.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeErrors.1.normal.js @@ -5,7 +5,7 @@ }); // Error, string is not assignable to number /*#__PURE__*/ React.createElement("div", { - width: "foo" + width: 'foo' }); // Error, number is not assignable to string var attribs = { @@ -15,5 +15,5 @@ var attribs = { // No errors here /*#__PURE__*/ React.createElement("span", { foo: "bar", - bar: "foo" + bar: 'foo' }); diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution1.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution1.1.normal.js index 9f7aca6844d7..b91e85710675 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution1.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution1.1.normal.js @@ -11,11 +11,11 @@ reqd: "true" }); // OK /*#__PURE__*/ React.createElement("test2", { - reqd: "true" + reqd: 'true' }); // OK // Errors /*#__PURE__*/ React.createElement("test1", { - x: "0" + x: '0' }); // Error, '0' is not number /*#__PURE__*/ React.createElement("test1", { y: 0 diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution3.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution3.1.normal.js index d1f818502de1..e68b2213bd1a 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution3.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution3.1.normal.js @@ -3,7 +3,7 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread"; import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props"; // OK var obj1 = { - x: "foo" + x: 'foo' }; /*#__PURE__*/ React.createElement("test1", obj1); // Error, x is not string @@ -34,14 +34,14 @@ var obj5 = { }, obj5)); // Ok var obj6 = { - x: "ok", + x: 'ok', y: 32, extra: 100 }; /*#__PURE__*/ React.createElement("test1", obj6); // OK (spread override) var obj7 = { - x: "foo" + x: 'foo' }; /*#__PURE__*/ React.createElement("test1", _object_spread({ x: 32 diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution3.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeResolution3.2.minified.js index 2eed239fc3d3..ad6cee1d359e 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution3.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution3.2.minified.js @@ -14,5 +14,5 @@ _object_spread_props(_object_spread({}, { }), _object_spread({ x: 32 }, { - x: "foo" + x: 'foo' }); diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution7.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution7.1.normal.js index b7793d0fd7e7..ea33ebd1ff30 100644 --- a/crates/swc/tests/tsc-references/tsxAttributeResolution7.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxAttributeResolution7.1.normal.js @@ -5,10 +5,10 @@ }); // OK /*#__PURE__*/ React.createElement("test1", { - "data-foo": "32" + "data-foo": '32' }); /*#__PURE__*/ React.createElement("test1", { - "data-bar": "32" + "data-bar": '32' }); /*#__PURE__*/ React.createElement("test1", { "data-bar": 32 diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName5.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName5.1.normal.js index f329387606a8..424443791662 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName5.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName5.1.normal.js @@ -4,7 +4,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -import * as React from "react"; +import * as React from 'react'; export var Text = /*#__PURE__*/ function(_React_Component) { "use strict"; _inherits(Text, _React_Component); @@ -13,7 +13,7 @@ export var Text = /*#__PURE__*/ function(_React_Component) { _class_call_check(this, Text); var _this; _this = _super.apply(this, arguments); - _this._tagName = "div"; + _this._tagName = 'div'; return _this; } var _proto = Text.prototype; diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName5.2.minified.js b/crates/swc/tests/tsc-references/tsxDynamicTagName5.2.minified.js index 76ff4b4d1bc5..65b07d2d2f76 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName5.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName5.2.minified.js @@ -4,13 +4,13 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -import * as React from "react"; +import * as React from 'react'; export var Text = function(_React_Component) { _inherits(Text, _React_Component); var _super = _create_super(Text); function Text() { var _this; - return _class_call_check(this, Text), _this = _super.apply(this, arguments), _this._tagName = "div", _this; + return _class_call_check(this, Text), _this = _super.apply(this, arguments), _this._tagName = 'div', _this; } return Text.prototype.render = function() { return React.createElement(this._tagName, null); diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName6.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName6.1.normal.js index fef270e02da3..3b8ca1dced27 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName6.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName6.1.normal.js @@ -1,6 +1,6 @@ //// [tsxDynamicTagName6.tsx] var t = { - tag: "h1" + tag: 'h1' }; var foo = /*#__PURE__*/ React.createElement(t.tag, null) // No error ; diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName7.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName7.1.normal.js index cd10e27d5d2d..c24d17f44cb0 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName7.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName7.1.normal.js @@ -4,7 +4,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -import * as React from "react"; +import * as React from 'react'; export var Text = /*#__PURE__*/ function(_React_Component) { "use strict"; _inherits(Text, _React_Component); @@ -13,7 +13,7 @@ export var Text = /*#__PURE__*/ function(_React_Component) { _class_call_check(this, Text); var _this; _this = _super.apply(this, arguments); - _this._tagName = "div"; + _this._tagName = 'div'; return _this; } var _proto = Text.prototype; diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName7.2.minified.js b/crates/swc/tests/tsc-references/tsxDynamicTagName7.2.minified.js index e1913e93d026..8c4f1e3caad7 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName7.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName7.2.minified.js @@ -4,13 +4,13 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -import * as React from "react"; +import * as React from 'react'; export var Text = function(_React_Component) { _inherits(Text, _React_Component); var _super = _create_super(Text); function Text() { var _this; - return _class_call_check(this, Text), _this = _super.apply(this, arguments), _this._tagName = "div", _this; + return _class_call_check(this, Text), _this = _super.apply(this, arguments), _this._tagName = 'div', _this; } return Text.prototype.render = function() { return React.createElement(this, null); diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName8.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName8.1.normal.js index 0ce5716cdc90..0ce4c006b691 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName8.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName8.1.normal.js @@ -4,7 +4,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -import * as React from "react"; +import * as React from 'react'; export var Text = /*#__PURE__*/ function(_React_Component) { "use strict"; _inherits(Text, _React_Component); @@ -13,7 +13,7 @@ export var Text = /*#__PURE__*/ function(_React_Component) { _class_call_check(this, Text); var _this; _this = _super.apply(this, arguments); - _this._tagName = "div"; + _this._tagName = 'div'; return _this; } var _proto = Text.prototype; diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName8.2.minified.js b/crates/swc/tests/tsc-references/tsxDynamicTagName8.2.minified.js index 34d607db836d..902658bfebcc 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName8.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName8.2.minified.js @@ -4,13 +4,13 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -import * as React from "react"; +import * as React from 'react'; export var Text = function(_React_Component) { _inherits(Text, _React_Component); var _super = _create_super(Text); function Text() { var _this; - return _class_call_check(this, Text), _this = _super.apply(this, arguments), _this._tagName = "div", _this; + return _class_call_check(this, Text), _this = _super.apply(this, arguments), _this._tagName = 'div', _this; } return Text.prototype.render = function() { return React.createElement(this._tagName, null, " Hello world "); diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName9.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName9.1.normal.js index c91fd3d40d71..98271a0e1419 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName9.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName9.1.normal.js @@ -4,7 +4,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -import * as React from "react"; +import * as React from 'react'; export var Text = /*#__PURE__*/ function(_React_Component) { "use strict"; _inherits(Text, _React_Component); @@ -13,7 +13,7 @@ export var Text = /*#__PURE__*/ function(_React_Component) { _class_call_check(this, Text); var _this; _this = _super.apply(this, arguments); - _this._tagName = "div"; + _this._tagName = 'div'; return _this; } var _proto = Text.prototype; diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName9.2.minified.js b/crates/swc/tests/tsc-references/tsxDynamicTagName9.2.minified.js index 57bbce03338e..89383a50ad86 100644 --- a/crates/swc/tests/tsc-references/tsxDynamicTagName9.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxDynamicTagName9.2.minified.js @@ -4,13 +4,13 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -import * as React from "react"; +import * as React from 'react'; export var Text = function(_React_Component) { _inherits(Text, _React_Component); var _super = _create_super(Text); function Text() { var _this; - return _class_call_check(this, Text), _this = _super.apply(this, arguments), _this._tagName = "div", _this; + return _class_call_check(this, Text), _this = _super.apply(this, arguments), _this._tagName = 'div', _this; } return Text.prototype.render = function() { return React.createElement(this._tagName, null, " Hello world "); diff --git a/crates/swc/tests/tsc-references/tsxElementResolution12.1.normal.js b/crates/swc/tests/tsc-references/tsxElementResolution12.1.normal.js index 7433be50633c..e8b012bc6a71 100644 --- a/crates/swc/tests/tsc-references/tsxElementResolution12.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxElementResolution12.1.normal.js @@ -19,5 +19,5 @@ var Obj4; x: 10 }); // OK /*#__PURE__*/ React.createElement(Obj4, { - x: "10" + x: '10' }); // Error diff --git a/crates/swc/tests/tsc-references/tsxReactEmitEntities.1.normal.js b/crates/swc/tests/tsc-references/tsxReactEmitEntities.1.normal.js index 94662614f60f..4a057e9a5ede 100644 --- a/crates/swc/tests/tsc-references/tsxReactEmitEntities.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxReactEmitEntities.1.normal.js @@ -10,7 +10,7 @@ }); // Does not happen for a string literal that happens to be inside an attribute (and escapes then work) /*#__PURE__*/ React.createElement("div", { - attr: '{…}"' + attr: "{…}\"" }); // Preserves single quotes /*#__PURE__*/ React.createElement("div", { diff --git a/crates/swc/tests/tsc-references/tsxTypeErrors.1.normal.js b/crates/swc/tests/tsc-references/tsxTypeErrors.1.normal.js index ad7e1d868065..83b096809626 100644 --- a/crates/swc/tests/tsc-references/tsxTypeErrors.1.normal.js +++ b/crates/swc/tests/tsc-references/tsxTypeErrors.1.normal.js @@ -36,6 +36,6 @@ var b1 = /*#__PURE__*/ React.createElement(MyClass, { var b2 = /*#__PURE__*/ React.createElement(MyClass, { pt: { x: 4, - y: "oops" + y: 'oops' } }); diff --git a/crates/swc/tests/tsc-references/typeArgumentInference.1.normal.js b/crates/swc/tests/tsc-references/typeArgumentInference.1.normal.js index 55013988d89a..b44f3ebb87d7 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInference.1.normal.js +++ b/crates/swc/tests/tsc-references/typeArgumentInference.1.normal.js @@ -6,9 +6,9 @@ noParams(); noParams(); // Generic call with parameters but none use type parameter type function noGenericParams(n) {} -noGenericParams(""); -noGenericParams(""); -noGenericParams(""); +noGenericParams(''); +noGenericParams(''); +noGenericParams(''); // Generic call with multiple type parameters and only one used in parameter type annotation function someGenerics1(n, m) {} someGenerics1(3, 4); @@ -37,7 +37,7 @@ someGenerics2b(function(n, t) { // Generic call with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter function someGenerics3(producer) {} someGenerics3(function() { - return ""; + return ''; }); someGenerics3(function() { return undefined; @@ -50,7 +50,7 @@ function someGenerics4(n, f) {} someGenerics4(4, function() { return null; }); -someGenerics4("", function() { +someGenerics4('', function() { return 3; }); someGenerics4(null, null); @@ -59,7 +59,7 @@ function someGenerics5(n, f) {} someGenerics5(4, function() { return null; }); -someGenerics5("", function() { +someGenerics5('', function() { return 3; }); someGenerics5(null, null); @@ -119,12 +119,12 @@ x(null, null, null); function someGenerics9(a, b, c) { return null; } -var a9a = someGenerics9("", 0, []); +var a9a = someGenerics9('', 0, []); var a9a; var a9b = someGenerics9({ a: 0 }, { - b: "" + b: '' }, null); var a9b; var a9e = someGenerics9(undefined, { @@ -132,7 +132,7 @@ var a9e = someGenerics9(undefined, { z: new Date() }, { x: 6, - y: "" + y: '' }); var a9e; var a9f = someGenerics9(undefined, { @@ -140,7 +140,7 @@ var a9f = someGenerics9(undefined, { z: new Date() }, { x: 6, - y: "" + y: '' }); var a9f; // Generic call with multiple parameters of generic type passed arguments with a single best common type diff --git a/crates/swc/tests/tsc-references/typeArgumentInferenceConstructSignatures.1.normal.js b/crates/swc/tests/tsc-references/typeArgumentInferenceConstructSignatures.1.normal.js index 950c59677bdf..efbeba1e8585 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInferenceConstructSignatures.1.normal.js +++ b/crates/swc/tests/tsc-references/typeArgumentInferenceConstructSignatures.1.normal.js @@ -5,9 +5,9 @@ new noParams(); new noParams(); new noParams(); var noGenericParams; -new noGenericParams(""); -new noGenericParams(""); -new noGenericParams(""); +new noGenericParams(''); +new noGenericParams(''); +new noGenericParams(''); var someGenerics1; new someGenerics1(3, 4); new someGenerics1(3, 4); // Error @@ -34,7 +34,7 @@ new someGenerics2b(function(n, t) { }); var someGenerics3; new someGenerics3(function() { - return ""; + return ''; }); new someGenerics3(function() { return undefined; @@ -46,22 +46,22 @@ var someGenerics4; new someGenerics4(4, function() { return null; }); -new someGenerics4("", function() { +new someGenerics4('', function() { return 3; }); -new someGenerics4("", function(x) { - return ""; +new someGenerics4('', function(x) { + return ''; }); // Error new someGenerics4(null, null); var someGenerics5; new someGenerics5(4, function() { return null; }); -new someGenerics5("", function() { +new someGenerics5('', function() { return 3; }); -new someGenerics5("", function(x) { - return ""; +new someGenerics5('', function(x) { + return ''; }); // Error new someGenerics5(null, null); var someGenerics6; @@ -119,12 +119,12 @@ var someGenerics8; var x = new someGenerics8(someGenerics7); new x(null, null, null); var someGenerics9; -var a9a = new someGenerics9("", 0, []); +var a9a = new someGenerics9('', 0, []); var a9a; var a9b = new someGenerics9({ a: 0 }, { - b: "" + b: '' }, null); var a9b; var a9e = new someGenerics9(undefined, { @@ -132,7 +132,7 @@ var a9e = new someGenerics9(undefined, { z: window }, { x: 6, - y: "" + y: '' }); var a9e; var a9f = new someGenerics9(undefined, { @@ -140,7 +140,7 @@ var a9f = new someGenerics9(undefined, { z: window }, { x: 6, - y: "" + y: '' }); var a9f; // Generic call with multiple parameters of generic type passed arguments with a single best common type diff --git a/crates/swc/tests/tsc-references/typeArgumentInferenceConstructSignatures.2.minified.js b/crates/swc/tests/tsc-references/typeArgumentInferenceConstructSignatures.2.minified.js index e6d9fd657ffb..e5b7ef358f1d 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInferenceConstructSignatures.2.minified.js +++ b/crates/swc/tests/tsc-references/typeArgumentInferenceConstructSignatures.2.minified.js @@ -1,6 +1,6 @@ //// [typeArgumentInferenceConstructSignatures.ts] var noParams, noGenericParams, someGenerics1, someGenerics2a, someGenerics2b, someGenerics3, someGenerics4, someGenerics5, someGenerics6, someGenerics7, someGenerics9, anyVar; -new noParams(), new noParams(), new noParams(), new noGenericParams(""), new noGenericParams(""), new noGenericParams(""), new someGenerics1(3, 4), new someGenerics1(3, 4), new someGenerics1(3, 4), new someGenerics2a(function(n) { +new noParams(), new noParams(), new noParams(), new noGenericParams(''), new noGenericParams(''), new noGenericParams(''), new someGenerics1(3, 4), new someGenerics1(3, 4), new someGenerics1(3, 4), new someGenerics2a(function(n) { return n; }), new someGenerics2a(function(n) { return n; @@ -13,21 +13,21 @@ new noParams(), new noParams(), new noParams(), new noGenericParams(""), new noG }), new someGenerics2b(function(n, t) { return n.substr(t * t); }), new someGenerics3(function() { - return ""; + return ''; }), new someGenerics3(function() {}), new someGenerics3(function() { return 3; }), new someGenerics4(4, function() { return null; -}), new someGenerics4("", function() { +}), new someGenerics4('', function() { return 3; -}), new someGenerics4("", function(x) { - return ""; +}), new someGenerics4('', function(x) { + return ''; }), new someGenerics4(null, null), new someGenerics5(4, function() { return null; -}), new someGenerics5("", function() { +}), new someGenerics5('', function() { return 3; -}), new someGenerics5("", function(x) { - return ""; +}), new someGenerics5('', function(x) { + return ''; }), new someGenerics5(null, null), new someGenerics6(function(n) { return n; }, function(n) { @@ -70,22 +70,22 @@ new noParams(), new noParams(), new noParams(), new noGenericParams(""), new noG return n; }, function(n) { return n; -}), new new (void 0)(someGenerics7)(null, null, null), new someGenerics9("", 0, []), new someGenerics9({ +}), new new (void 0)(someGenerics7)(null, null, null), new someGenerics9('', 0, []), new someGenerics9({ a: 0 }, { - b: "" + b: '' }, null), new someGenerics9(void 0, { x: 6, z: window }, { x: 6, - y: "" + y: '' }), new someGenerics9(void 0, { x: 6, z: window }, { x: 6, - y: "" + y: '' }), new someGenerics9({ x: 3 }, { diff --git a/crates/swc/tests/tsc-references/typeArgumentInferenceErrors.1.normal.js b/crates/swc/tests/tsc-references/typeArgumentInferenceErrors.1.normal.js index 40b382b3504c..c519cd109e7c 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInferenceErrors.1.normal.js +++ b/crates/swc/tests/tsc-references/typeArgumentInferenceErrors.1.normal.js @@ -4,13 +4,13 @@ function someGenerics1(n, m) {} someGenerics1(3, 4); // Error // 2 parameter generic call with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type function someGenerics4(n, f) {} -someGenerics4("", function(x) { - return ""; +someGenerics4('', function(x) { + return ''; }); // Error // 2 parameter generic call with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type function someGenerics5(n, f) {} -someGenerics5("", function(x) { - return ""; +someGenerics5('', function(x) { + return ''; }); // Error // Generic call with multiple arguments of function types that each have parameters of the same generic type function someGenerics6(a, b, c) {} diff --git a/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints.1.normal.js b/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints.1.normal.js index dc0ea9c2846c..44fd7cb03f6a 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints.1.normal.js +++ b/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints.1.normal.js @@ -6,9 +6,9 @@ noParams(); noParams(); // Generic call with parameters but none use type parameter type function noGenericParams(n) {} -noGenericParams(""); // Valid -noGenericParams(""); -noGenericParams(""); // Error +noGenericParams(''); // Valid +noGenericParams(''); +noGenericParams(''); // Error // Generic call with multiple type parameters and only one used in parameter type annotation function someGenerics1(n, m) {} someGenerics1(3, 4); // Valid @@ -39,7 +39,7 @@ someGenerics2b(function(n, t) { // Generic call with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter function someGenerics3(producer) {} someGenerics3(function() { - return ""; + return ''; }); // Error someGenerics3(function() { return undefined; @@ -52,11 +52,11 @@ function someGenerics4(n, f) {} someGenerics4(4, function() { return null; }); // Valid -someGenerics4("", function() { +someGenerics4('', function() { return 3; }); -someGenerics4("", function(x) { - return ""; +someGenerics4('', function(x) { + return ''; }); // Error someGenerics4(null, null); // 2 parameter generic call with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type @@ -64,11 +64,11 @@ function someGenerics5(n, f) {} someGenerics5(4, function() { return null; }); // Valid -someGenerics5("", function() { +someGenerics5('', function() { return 3; }); -someGenerics5("", function(x) { - return ""; +someGenerics5('', function(x) { + return ''; }); // Error someGenerics5(null, null); // Error // Generic call with multiple arguments of function types that each have parameters of the same generic type @@ -134,12 +134,12 @@ x(null, null, null); // Error function someGenerics9(a, b, c) { return null; } -var a9a = someGenerics9("", 0, []); +var a9a = someGenerics9('', 0, []); var a9a; var a9b = someGenerics9({ a: 0 }, { - b: "" + b: '' }, null); var a9b; var a9e = someGenerics9(undefined, { @@ -147,7 +147,7 @@ var a9e = someGenerics9(undefined, { z: window }, { x: 6, - y: "" + y: '' }); var a9e; var a9f = someGenerics9(undefined, { @@ -155,7 +155,7 @@ var a9f = someGenerics9(undefined, { z: window }, { x: 6, - y: "" + y: '' }); var a9f; // Generic call with multiple parameters of generic type passed arguments with a single best common type diff --git a/crates/swc/tests/tsc-references/typeFromJSConstructor.1.normal.js b/crates/swc/tests/tsc-references/typeFromJSConstructor.1.normal.js index 1dc7a3a7974c..44a7d9caf9c9 100644 --- a/crates/swc/tests/tsc-references/typeFromJSConstructor.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromJSConstructor.1.normal.js @@ -6,21 +6,21 @@ function Installer() { this.unknown = null; // twice: string | undefined this.twice = undefined; - this.twice = "hi"; + this.twice = 'hi'; // twices: any[] | null this.twices = []; this.twices = null; } Installer.prototype.first = function() { - this.arg = "hi" // error + this.arg = 'hi' // error ; - this.unknown = "hi" // ok + this.unknown = 'hi' // ok ; this.newProperty = 1 // ok: number | boolean ; this.twice = undefined // ok ; - this.twice = "hi" // ok + this.twice = 'hi' // ok ; }; Installer.prototype.second = function() { @@ -37,6 +37,6 @@ Installer.prototype.second = function() { this.twices.push(1) // error: Object is possibly null ; if (this.twices != null) { - this.twices.push("hi"); + this.twices.push('hi'); } }; diff --git a/crates/swc/tests/tsc-references/typeFromJSConstructor.2.minified.js b/crates/swc/tests/tsc-references/typeFromJSConstructor.2.minified.js index c942a82a1ef4..5f7c80752047 100644 --- a/crates/swc/tests/tsc-references/typeFromJSConstructor.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromJSConstructor.2.minified.js @@ -1,9 +1,9 @@ //// [a.js] function Installer() { - this.arg = 0, this.unknown = null, this.twice = void 0, this.twice = "hi", this.twices = [], this.twices = null; + this.arg = 0, this.unknown = null, this.twice = void 0, this.twice = 'hi', this.twices = [], this.twices = null; } Installer.prototype.first = function() { - this.arg = "hi", this.unknown = "hi", this.newProperty = 1, this.twice = void 0, this.twice = "hi"; + this.arg = 'hi', this.unknown = 'hi', this.newProperty = 1, this.twice = void 0, this.twice = 'hi'; }, Installer.prototype.second = function() { - this.arg = !1, this.unknown = !1, this.newProperty = !1, this.twice = null, this.twice = !1, this.twices.push(1), null != this.twices && this.twices.push("hi"); + this.arg = !1, this.unknown = !1, this.newProperty = !1, this.twice = null, this.twice = !1, this.twices.push(1), null != this.twices && this.twices.push('hi'); }; diff --git a/crates/swc/tests/tsc-references/typeFromJSInitializer.1.normal.js b/crates/swc/tests/tsc-references/typeFromJSInitializer.1.normal.js index 91db27bc4535..6fff50dca445 100644 --- a/crates/swc/tests/tsc-references/typeFromJSInitializer.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromJSInitializer.1.normal.js @@ -9,15 +9,15 @@ var a = new A(); a.unknown = 1; a.unknown = true; a.unknown = {}; -a.unknown = "hi"; +a.unknown = 'hi'; a.unknowable = 1; a.unknowable = true; a.unknowable = {}; -a.unknowable = "hi"; +a.unknowable = 'hi'; a.empty.push(1); a.empty.push(true); a.empty.push({}); -a.empty.push("hi"); +a.empty.push('hi'); /** @type {number | undefined} */ var n; // should get any on parameter initialisers function f() { @@ -28,14 +28,14 @@ function f() { a = 1; a = true; a = {}; - a = "ok"; + a = 'ok'; // b should be number | undefined, not any b = 1; b = undefined; - b = "error"; + b = 'error'; // l should be any[] l.push(1); - l.push("ok"); + l.push('ok'); } // should get any on variable initialisers var u = undefined; @@ -44,8 +44,8 @@ u = undefined; u = 1; u = true; u = {}; -u = "ok"; -l.push("ok"); +u = 'ok'; +l.push('ok'); /** @type {(v: unknown) => v is undefined} */ var isUndef = function(v) { return v === undefined; }; diff --git a/crates/swc/tests/tsc-references/typeFromJSInitializer.2.minified.js b/crates/swc/tests/tsc-references/typeFromJSInitializer.2.minified.js index 2fdbe2af5c90..4fad4fc25357 100644 --- a/crates/swc/tests/tsc-references/typeFromJSInitializer.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromJSInitializer.2.minified.js @@ -2,7 +2,7 @@ var a = new function() { this.unknown = null, this.unknowable = void 0, this.empty = []; }(); -a.unknown = 1, a.unknown = !0, a.unknown = {}, a.unknown = "hi", a.unknowable = 1, a.unknowable = !0, a.unknowable = {}, a.unknowable = "hi", a.empty.push(1), a.empty.push(!0), a.empty.push({}), a.empty.push("hi"), [].push("ok"), [ +a.unknown = 1, a.unknown = !0, a.unknown = {}, a.unknown = 'hi', a.unknowable = 1, a.unknowable = !0, a.unknowable = {}, a.unknowable = 'hi', a.empty.push(1), a.empty.push(!0), a.empty.push({}), a.empty.push('hi'), [].push('ok'), [ 1, void 0 ].filter(function(v) { diff --git a/crates/swc/tests/tsc-references/typeFromJSInitializer4.1.normal.js b/crates/swc/tests/tsc-references/typeFromJSInitializer4.1.normal.js index 22c780c4bd9a..05a7c299f94e 100644 --- a/crates/swc/tests/tsc-references/typeFromJSInitializer4.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromJSInitializer4.1.normal.js @@ -9,12 +9,12 @@ function f() { a = 1; a = true; a = {}; - a = "ok"; + a = 'ok'; // b should be number | undefined, not any b = 1; b = undefined; - b = "error"; + b = 'error'; // l should be any[] l.push(1); - l.push("ok"); + l.push('ok'); } diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment17.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment17.1.normal.js index b301660b83d3..c3767844b778 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment17.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment17.1.normal.js @@ -15,7 +15,7 @@ M.prototype.m = function() {}; function M() {} //// [use.js] /// -var mini = require("./minimatch"); +var mini = require('./minimatch'); mini.M.defaults(); var m = new mini.M(); m.m(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment17.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment17.2.minified.js index 356245243dbc..4f717fde73ca 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment17.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment17.2.minified.js @@ -8,5 +8,5 @@ module.exports = minimatch, minimatch.M = M, minimatch.filter = function() { return def; }, M.prototype.m = function() {}; //// [use.js] -var mini = require("./minimatch"); +var mini = require('./minimatch'); mini.M.defaults(), new mini.M().m(), mini.filter(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment21.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment21.1.normal.js index 9a42c41eb447..cd718f5df28f 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment21.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment21.1.normal.js @@ -1,5 +1,5 @@ //// [chrome-devtools-DOMExtension.js] // Extend that DOM! (doesn't work, but shouldn't crash) Event.prototype.removeChildren = function() { - this.textContent = "nope, not going to happen"; + this.textContent = 'nope, not going to happen'; }; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment21.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment21.2.minified.js index 947c2fab396a..2df0b7cf4830 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment21.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment21.2.minified.js @@ -1,4 +1,4 @@ //// [chrome-devtools-DOMExtension.js] Event.prototype.removeChildren = function() { - this.textContent = "nope, not going to happen"; + this.textContent = 'nope, not going to happen'; }; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment22.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment22.1.normal.js index cb20411f0079..151ed2e2d112 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment22.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment22.1.normal.js @@ -6,7 +6,7 @@ Installer.prototype.loadArgMetadata = function(next) { var _this = this; // ArrowFunction isn't treated as a this-container (function(args) { - _this.args = "hi"; + _this.args = 'hi'; _this.newProperty = 1; }); }; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment23.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment23.1.normal.js index 5247d7ace405..17b7a27a135f 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment23.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment23.1.normal.js @@ -36,7 +36,7 @@ var D = /*#__PURE__*/ function(B) { return D; }(B); D.prototype.foo = function() { - _this.n = "not checked, so no error"; + _this.n = 'not checked, so no error'; }; // post-class prototype assignments are trying to show that these properties are abstract var Module = function Module() { @@ -55,7 +55,7 @@ var NormalModule = /*#__PURE__*/ function(Module) { } var _proto = NormalModule.prototype; _proto.identifier = function identifier() { - return "normal"; + return 'normal'; }; _proto.size = function size() { return 0; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment23.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment23.2.minified.js index cab72fd9950f..20c2cb799d0a 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment23.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment23.2.minified.js @@ -23,7 +23,7 @@ var _this = this, B = function() { } return D; }(B).prototype.foo = function() { - _this.n = "not checked, so no error"; + _this.n = 'not checked, so no error'; }; var Module = function Module() { _class_call_check(this, Module); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment24.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment24.1.normal.js index f6b9f7bb8ed2..55afff9f4d56 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment24.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment24.1.normal.js @@ -15,7 +15,7 @@ Outer.Inner = /*#__PURE__*/ function() { } var _proto = _class.prototype; _proto.name = function name() { - return "hi"; + return 'hi'; }; return _class; }(); diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment36.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment36.1.normal.js index cf4cf70a150a..bfcfc85ef584 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment36.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment36.1.normal.js @@ -21,7 +21,7 @@ function f(b) { } d.r; if (b) { - d.s = "hi"; + d.s = 'hi'; } return d; } @@ -54,7 +54,7 @@ if (!!false) { g.expando // error ; if (!!false) { - g.both = "hi"; + g.both = 'hi'; } else { g.both = 0; } diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment36.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment36.2.minified.js index 0f7036037fc6..39f3e283ce2e 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment36.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment36.2.minified.js @@ -2,7 +2,7 @@ function d() {} (function(b) { function d() {} - return d.e = 12, d.e, b && (d.q = !1), d.q, b ? d.q = !1 : d.q = !0, d.q, b ? d.r = 1 : d.r = 2, d.r, b && (d.s = "hi"), d; + return d.e = 12, d.e, b && (d.q = !1), d.q, b ? d.q = !1 : d.q = !0, d.q, b ? d.r = 1 : d.r = 2, d.r, b && (d.s = 'hi'), d; })(!0).s, d.e = 12, d.e, d.q, d.q = !0, d.q, d.r = 2, d.r; var g = function() {}; g.expando, g.both = 0, g.both; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment37.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment37.1.normal.js index 648e08f7aa21..af98fb5622dd 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment37.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment37.1.normal.js @@ -4,7 +4,7 @@ if (!!false) { util.existy = function() {}; } //// [use.js] -var util = require("./mod"); +var util = require('./mod'); function n() { util.existy // no error ; diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment37.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment37.2.minified.js index 854b90c4cff3..c7cfc08a5ac8 100644 --- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment37.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment37.2.minified.js @@ -1,4 +1,4 @@ //// [mod.js] exports = module.exports = {}; //// [use.js] -require("./mod").existy; +require('./mod').existy; diff --git a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3.1.normal.js b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3.1.normal.js index 34ca52aeee2c..6303404af192 100644 --- a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3.1.normal.js @@ -7,8 +7,8 @@ Multimap3.prototype = { * @param {string} key * @returns {number} the value ok */ get: function get(key) { - return this._map[key + ""]; + return this._map[key + '']; } }; /** @type {Multimap3} */ var map = new Multimap3(); -var n = map.get("hi"); +var n = map.get('hi'); diff --git a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3.2.minified.js b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3.2.minified.js index 3975a2b481ae..83803c119231 100644 --- a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment3.2.minified.js @@ -4,6 +4,6 @@ function Multimap3() { } Multimap3.prototype = { get: function(key) { - return this._map[key + ""]; + return this._map[key + '']; } -}, new Multimap3().get("hi"); +}, new Multimap3().get('hi'); diff --git a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4.1.normal.js b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4.1.normal.js index 9bac35b9496d..736f636fb419 100644 --- a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4.1.normal.js +++ b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4.1.normal.js @@ -7,7 +7,7 @@ Multimap4["prototype"] = { * @param {string} key * @returns {number} the value ok */ get: function get(key) { - return this._map[key + ""]; + return this._map[key + '']; } }; Multimap4["prototype"]["add-on"] = function() {}; diff --git a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4.2.minified.js b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4.2.minified.js index 57cbda442272..a326a4fd24bd 100644 --- a/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4.2.minified.js +++ b/crates/swc/tests/tsc-references/typeFromPrototypeAssignment4.2.minified.js @@ -4,7 +4,7 @@ function Multimap4() { } Multimap4.prototype = { get: function(key) { - return this._map[key + ""]; + return this._map[key + '']; } }, Multimap4.prototype["add-on"] = function() {}, Multimap4.prototype.addon = function() {}, Multimap4.prototype.__underscores__ = function() {}; var map4 = new Multimap4(); diff --git a/crates/swc/tests/tsc-references/typeGuardIntersectionTypes.1.normal.js b/crates/swc/tests/tsc-references/typeGuardIntersectionTypes.1.normal.js index e65349220418..8af8a9789698 100644 --- a/crates/swc/tests/tsc-references/typeGuardIntersectionTypes.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardIntersectionTypes.1.normal.js @@ -21,7 +21,7 @@ function union(a) { } // Beast feature detection via user-defined type guards function hasLegs(x) { - return x && typeof x.legs === "number"; + return x && typeof x.legs === 'number'; } function hasWings(x) { return x && !!x.wings; diff --git a/crates/swc/tests/tsc-references/typeGuardNesting.1.normal.js b/crates/swc/tests/tsc-references/typeGuardNesting.1.normal.js index 09982e284c17..7117cea84f65 100644 --- a/crates/swc/tests/tsc-references/typeGuardNesting.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardNesting.1.normal.js @@ -1,14 +1,14 @@ //// [typeGuardNesting.ts] var strOrBool; -if (typeof strOrBool === "boolean" && !strOrBool || typeof strOrBool === "string") { - var label = typeof strOrBool === "string" ? strOrBool : "string"; - var bool = typeof strOrBool === "boolean" ? strOrBool : false; - var label2 = typeof strOrBool !== "boolean" ? strOrBool : "string"; - var bool2 = typeof strOrBool !== "string" ? strOrBool : false; +if (typeof strOrBool === 'boolean' && !strOrBool || typeof strOrBool === 'string') { + var label = typeof strOrBool === 'string' ? strOrBool : "string"; + var bool = typeof strOrBool === 'boolean' ? strOrBool : false; + var label2 = typeof strOrBool !== 'boolean' ? strOrBool : "string"; + var bool2 = typeof strOrBool !== 'string' ? strOrBool : false; } -if (typeof strOrBool !== "string" && !strOrBool || typeof strOrBool !== "boolean") { - var label1 = typeof strOrBool === "string" ? strOrBool : "string"; - var bool1 = typeof strOrBool === "boolean" ? strOrBool : false; - var label21 = typeof strOrBool !== "boolean" ? strOrBool : "string"; - var bool21 = typeof strOrBool !== "string" ? strOrBool : false; +if (typeof strOrBool !== 'string' && !strOrBool || typeof strOrBool !== 'boolean') { + var label1 = typeof strOrBool === 'string' ? strOrBool : "string"; + var bool1 = typeof strOrBool === 'boolean' ? strOrBool : false; + var label21 = typeof strOrBool !== 'boolean' ? strOrBool : "string"; + var bool21 = typeof strOrBool !== 'string' ? strOrBool : false; } diff --git a/crates/swc/tests/tsc-references/typeGuardOfFormTypeOfFunction.1.normal.js b/crates/swc/tests/tsc-references/typeGuardOfFormTypeOfFunction.1.normal.js index 37a2d85da22a..3c3196f6b40e 100644 --- a/crates/swc/tests/tsc-references/typeGuardOfFormTypeOfFunction.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardOfFormTypeOfFunction.1.normal.js @@ -57,7 +57,7 @@ function f100(obj, keys) { for(var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ var k = _step.value; var item = obj[k]; - if (typeof item == "function") item.call(obj); + if (typeof item == 'function') item.call(obj); } } catch (err) { _didIteratorError = true; @@ -77,7 +77,7 @@ function f100(obj, keys) { // Repro from #49316 function configureStore(reducer) { var rootReducer; - if (typeof reducer === "function") { + if (typeof reducer === 'function') { rootReducer = reducer; } } diff --git a/crates/swc/tests/tsc-references/typeGuardsAsAssertions.1.normal.js b/crates/swc/tests/tsc-references/typeGuardsAsAssertions.1.normal.js index 364f6dbe3ee4..63ac8022b686 100644 --- a/crates/swc/tests/tsc-references/typeGuardsAsAssertions.1.normal.js +++ b/crates/swc/tests/tsc-references/typeGuardsAsAssertions.1.normal.js @@ -2,10 +2,10 @@ // Repro from #8513 var cond; export var none = { - none: "" + none: '' }; export function isSome(value) { - return "some" in value; + return 'some' in value; } function someFrom(some) { return { diff --git a/crates/swc/tests/tsc-references/typeGuardsAsAssertions.2.minified.js b/crates/swc/tests/tsc-references/typeGuardsAsAssertions.2.minified.js index 78842ea4fbd0..1bbfe45ec9e8 100644 --- a/crates/swc/tests/tsc-references/typeGuardsAsAssertions.2.minified.js +++ b/crates/swc/tests/tsc-references/typeGuardsAsAssertions.2.minified.js @@ -1,10 +1,10 @@ //// [typeGuardsAsAssertions.ts] var cond; export var none = { - none: "" + none: '' }; export function isSome(value) { - return "some" in value; + return 'some' in value; } export function fn(makeSome) { for(var result = none; cond;)result = { diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers.1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers.1.normal.js index 07edc944a4c6..fd22ae895f65 100644 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers.1.normal.js +++ b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers.1.normal.js @@ -33,4 +33,4 @@ var t2 = C2.bar(); // all ok var r5 = t2.foo + 1; var r6 = t2.bar(); -var r7 = new t2(""); +var r7 = new t2(''); diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers.2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers.2.minified.js index fab2ecc2ad0c..97294ac3f34d 100644 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers.2.minified.js +++ b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers.2.minified.js @@ -17,4 +17,4 @@ var t2 = (function() { return this; }, C2; })().bar(); -t2.foo, t2.bar(), new t2(""); +t2.foo, t2.bar(), new t2(''); diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint.1.normal.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint.1.normal.js index 916db14026f3..73d6e02ce4af 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint.1.normal.js @@ -18,7 +18,7 @@ var r3 = foo({ function foo2(x, y) { return y; } -foo2(1, ""); +foo2(1, ''); foo2({}, { length: 2 }); @@ -28,5 +28,5 @@ foo2(1, { }); foo2(1, []); foo2(1, [ - "" + '' ]); diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2.1.normal.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2.1.normal.js index 158f6392353a..6642ab014635 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraint2.1.normal.js @@ -4,7 +4,7 @@ function foo(x, y) { return y; } // this is now an error -foo(1, ""); +foo(1, ''); foo(1, {}); var n; var r3 = foo(1, n); @@ -12,11 +12,11 @@ function foo2(x, y) { return y; } // this is now an error foo2(1, { - length: "" + length: '' }); foo2(1, { length: {} }); foo2([], [ - "" + '' ]); diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively.1.normal.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively.1.normal.js index b9744543da54..28a6ec569570 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively.1.normal.js @@ -13,16 +13,16 @@ foo({ x: 1 }, { x: 1, - y: "" + y: '' }, { x: 2, - y: "", + y: '', z: true }); foo(a, b, c); foo(a, b, { foo: 1, - bar: "", + bar: '', hm: true }); foo(function(x, y) {}, function(x) {}, function() {}); @@ -34,6 +34,6 @@ foo(a, a, a); foo(a, b, c); foo(b, b, { foo: 1, - bar: "", - hm: "" + bar: '', + hm: '' }); diff --git a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2.1.normal.js b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2.1.normal.js index 2c2ce78b0090..52c5ffa07ade 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2.1.normal.js +++ b/crates/swc/tests/tsc-references/typeParameterAsTypeParameterConstraintTransitively2.1.normal.js @@ -8,12 +8,12 @@ function foo(x, y, z) { return z; } //function foo(x: T, y: U, z: V): V { return z; } -foo(1, 2, ""); +foo(1, 2, ''); foo({ x: 1 }, { x: 1, - y: "" + y: '' }, { x: 2, y: 2, @@ -22,7 +22,7 @@ foo({ foo(a, b, a); foo(a, { foo: 1, - bar: "", + bar: '', hm: true }, b); foo(function(x, y) {}, function(x, y) {}, function() {}); diff --git a/crates/swc/tests/tsc-references/typeQueryOnClass.1.normal.js b/crates/swc/tests/tsc-references/typeQueryOnClass.1.normal.js index f96a556ea850..bf9d5724c0d9 100644 --- a/crates/swc/tests/tsc-references/typeQueryOnClass.1.normal.js +++ b/crates/swc/tests/tsc-references/typeQueryOnClass.1.normal.js @@ -14,7 +14,7 @@ var C = /*#__PURE__*/ function() { } var _proto = C.prototype; _proto.baz = function baz(x) { - return ""; + return ''; }; C.foo = function foo(x) {}; C.bar = function bar(x) {}; diff --git a/crates/swc/tests/tsc-references/typeQueryOnClass.2.minified.js b/crates/swc/tests/tsc-references/typeQueryOnClass.2.minified.js index 4dc210ba6007..11f5ef3657bc 100644 --- a/crates/swc/tests/tsc-references/typeQueryOnClass.2.minified.js +++ b/crates/swc/tests/tsc-references/typeQueryOnClass.2.minified.js @@ -9,7 +9,7 @@ var C = function() { }; } return C.prototype.baz = function(x) { - return ""; + return ''; }, C.foo = function(x) {}, C.bar = function(x) {}, _create_class(C, [ { key: "ic", diff --git a/crates/swc/tests/tsc-references/typeTagNoErasure.1.normal.js b/crates/swc/tests/tsc-references/typeTagNoErasure.1.normal.js index b2cd0cf2a346..f14d1d7336f9 100644 --- a/crates/swc/tests/tsc-references/typeTagNoErasure.1.normal.js +++ b/crates/swc/tests/tsc-references/typeTagNoErasure.1.normal.js @@ -4,5 +4,5 @@ }; test(1) // ok, T=1 ; -test("hi") // error, T=number +test('hi') // error, T=number ; diff --git a/crates/swc/tests/tsc-references/typeTagNoErasure.2.minified.js b/crates/swc/tests/tsc-references/typeTagNoErasure.2.minified.js index 9883485808e4..efbdfc029cd1 100644 --- a/crates/swc/tests/tsc-references/typeTagNoErasure.2.minified.js +++ b/crates/swc/tests/tsc-references/typeTagNoErasure.2.minified.js @@ -2,4 +2,4 @@ var test = function(dibbity) { return dibbity; }; -test(1), test("hi"); +test(1), test('hi'); diff --git a/crates/swc/tests/tsc-references/typeTagOnPropertyAssignment.1.normal.js b/crates/swc/tests/tsc-references/typeTagOnPropertyAssignment.1.normal.js index 946f9055470c..0b16490e4138 100644 --- a/crates/swc/tests/tsc-references/typeTagOnPropertyAssignment.1.normal.js +++ b/crates/swc/tests/tsc-references/typeTagOnPropertyAssignment.1.normal.js @@ -4,7 +4,7 @@ var o = { * @type {"a"} */ a: "a", /** @type {() => 'b'} */ n: function() { - return "b"; + return 'b'; } }; o.a; diff --git a/crates/swc/tests/tsc-references/typedefCrossModule.1.normal.js b/crates/swc/tests/tsc-references/typedefCrossModule.1.normal.js index fe95c632840b..0a3786727a9c 100644 --- a/crates/swc/tests/tsc-references/typedefCrossModule.1.normal.js +++ b/crates/swc/tests/tsc-references/typedefCrossModule.1.normal.js @@ -17,7 +17,7 @@ function C() { }; //// [use.js] /** @type {import('./mod1').Both} */ var both1 = { - type: "a", + type: 'a', x: 1 }; /** @type {import('./mod2').Both} */ var both2 = both1; diff --git a/crates/swc/tests/tsc-references/typedefCrossModule2.1.normal.js b/crates/swc/tests/tsc-references/typedefCrossModule2.1.normal.js index 3cdce614aa41..760800aa52ee 100644 --- a/crates/swc/tests/tsc-references/typedefCrossModule2.1.normal.js +++ b/crates/swc/tests/tsc-references/typedefCrossModule2.1.normal.js @@ -23,7 +23,7 @@ var Foo = function Foo() { Quack: 2 }; //// [use.js] -var mod = require("./mod1.js"); +var mod = require('./mod1.js'); /** @type {import("./mod1.js").Baz} */ var b; /** @type {mod.Baz} */ var bb; var bbb = new mod.Baz(); diff --git a/crates/swc/tests/tsc-references/typedefCrossModule2.2.minified.js b/crates/swc/tests/tsc-references/typedefCrossModule2.2.minified.js index e551bddbb1fd..d6b975af9a4b 100644 --- a/crates/swc/tests/tsc-references/typedefCrossModule2.2.minified.js +++ b/crates/swc/tests/tsc-references/typedefCrossModule2.2.minified.js @@ -10,4 +10,4 @@ exports.Bar = function _class() { Quack: 2 }; //// [use.js] -new (require("./mod1.js")).Baz(); +new (require('./mod1.js')).Baz(); diff --git a/crates/swc/tests/tsc-references/typedefOnSemicolonClassElement.1.normal.js b/crates/swc/tests/tsc-references/typedefOnSemicolonClassElement.1.normal.js index c224b38152b7..fb48293dd842 100644 --- a/crates/swc/tests/tsc-references/typedefOnSemicolonClassElement.1.normal.js +++ b/crates/swc/tests/tsc-references/typedefOnSemicolonClassElement.1.normal.js @@ -3,5 +3,5 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; export var Preferences = function Preferences() { "use strict"; _class_call_check(this, Preferences); - /** @type {A} */ this.a = "ok"; + /** @type {A} */ this.a = 'ok'; }; diff --git a/crates/swc/tests/tsc-references/typedefOnSemicolonClassElement.2.minified.js b/crates/swc/tests/tsc-references/typedefOnSemicolonClassElement.2.minified.js index 4037f69d0a08..eb19976bef08 100644 --- a/crates/swc/tests/tsc-references/typedefOnSemicolonClassElement.2.minified.js +++ b/crates/swc/tests/tsc-references/typedefOnSemicolonClassElement.2.minified.js @@ -1,5 +1,5 @@ //// [typedefOnSemicolonClassElement.js] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; export var Preferences = function Preferences() { - _class_call_check(this, Preferences), this.a = "ok"; + _class_call_check(this, Preferences), this.a = 'ok'; }; diff --git a/crates/swc/tests/tsc-references/typedefScope1.1.normal.js b/crates/swc/tests/tsc-references/typedefScope1.1.normal.js index f63000ade96f..17a9d3673e77 100644 --- a/crates/swc/tests/tsc-references/typedefScope1.1.normal.js +++ b/crates/swc/tests/tsc-references/typedefScope1.1.normal.js @@ -3,6 +3,6 @@ function B1() { /** @typedef {number} B */ /** @type {B} */ var ok1 = 0; } function B2() { - /** @typedef {string} B */ /** @type {B} */ var ok2 = "hi"; + /** @typedef {string} B */ /** @type {B} */ var ok2 = 'hi'; } /** @type {B} */ var notOK = 0; diff --git a/crates/swc/tests/tsc-references/typedefTagExtraneousProperty.1.normal.js b/crates/swc/tests/tsc-references/typedefTagExtraneousProperty.1.normal.js index 3918860d377b..d266a9c5f461 100644 --- a/crates/swc/tests/tsc-references/typedefTagExtraneousProperty.1.normal.js +++ b/crates/swc/tests/tsc-references/typedefTagExtraneousProperty.1.normal.js @@ -6,4 +6,4 @@ }; y; y.ignoreMe = "ok but just because of the index signature"; -y["hi"] = "yes"; +y['hi'] = "yes"; diff --git a/crates/swc/tests/tsc-references/typedefTagNested.1.normal.js b/crates/swc/tests/tsc-references/typedefTagNested.1.normal.js index 25fc4b933831..aad5eca65d0d 100644 --- a/crates/swc/tests/tsc-references/typedefTagNested.1.normal.js +++ b/crates/swc/tests/tsc-references/typedefTagNested.1.normal.js @@ -6,10 +6,10 @@ * @property {string} icons.image64 */ var ex; /** @type {App} */ var app = { - name: "name", + name: 'name', icons: { - image32: "x.png", - image64: "y.png" + image32: 'x.png', + image64: 'y.png' } }; /** @typedef {Object} Opp @@ -24,7 +24,7 @@ * @property {Object} not * @property {string} nested */ /** @type {Upp} */ var sala = { - name: "uppsala", + name: 'uppsala', not: 0, nested: "ok" }; diff --git a/crates/swc/tests/tsc-references/typeofANonExportedType.1.normal.js b/crates/swc/tests/tsc-references/typeofANonExportedType.1.normal.js index ce449d9fe33c..5b10a5ca9f38 100644 --- a/crates/swc/tests/tsc-references/typeofANonExportedType.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofANonExportedType.1.normal.js @@ -3,7 +3,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var x = 1; export var r1; var y = { - foo: "" + foo: '' }; export var r2; var C = function C() { @@ -21,7 +21,7 @@ export var r5; export var r5; var M; (function(M) { - M.foo = ""; + M.foo = ''; var C = function C() { "use strict"; _class_call_check(this, C); diff --git a/crates/swc/tests/tsc-references/typeofANonExportedType.2.minified.js b/crates/swc/tests/tsc-references/typeofANonExportedType.2.minified.js index cacd502bb48d..7ec1a792dc65 100644 --- a/crates/swc/tests/tsc-references/typeofANonExportedType.2.minified.js +++ b/crates/swc/tests/tsc-references/typeofANonExportedType.2.minified.js @@ -10,7 +10,7 @@ export var r4b; export var i; export var r5; export var r5; -(M1 = M || (M = {})).foo = "", M1.C = function C() { +(M1 = M || (M = {})).foo = '', M1.C = function C() { _class_call_check(this, C); }; export var r6; diff --git a/crates/swc/tests/tsc-references/typeofImportTypeOnlyExport.1.normal.js b/crates/swc/tests/tsc-references/typeofImportTypeOnlyExport.1.normal.js index 6d1d3d71678e..5ceb2858311c 100644 --- a/crates/swc/tests/tsc-references/typeofImportTypeOnlyExport.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofImportTypeOnlyExport.1.normal.js @@ -1,6 +1,6 @@ //// [typeofImportTypeOnlyExport.ts] //// [button.ts] -import { classMap } from "./lit.js"; +import { classMap } from './lit.js'; export var c = classMap(); //// [lit.ts] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; diff --git a/crates/swc/tests/tsc-references/typeofImportTypeOnlyExport.2.minified.js b/crates/swc/tests/tsc-references/typeofImportTypeOnlyExport.2.minified.js index a88bcc182643..5579bcc8e6d5 100644 --- a/crates/swc/tests/tsc-references/typeofImportTypeOnlyExport.2.minified.js +++ b/crates/swc/tests/tsc-references/typeofImportTypeOnlyExport.2.minified.js @@ -1,6 +1,6 @@ //// [typeofImportTypeOnlyExport.ts] //// [button.ts] -import { classMap } from "./lit.js"; +import { classMap } from './lit.js'; export var c = classMap(); //// [lit.ts] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; diff --git a/crates/swc/tests/tsc-references/typeofThis.1.normal.js b/crates/swc/tests/tsc-references/typeofThis.1.normal.js index c2954e18245d..d77a3e611273 100644 --- a/crates/swc/tests/tsc-references/typeofThis.1.normal.js +++ b/crates/swc/tests/tsc-references/typeofThis.1.normal.js @@ -11,16 +11,16 @@ var Test1 = function Test1() { "use strict"; _class_call_check(this, Test1); this.data = { - foo: "" + foo: '' }; - this["this"] = ""; + this['this'] = ''; var copy = { - foo: "" + foo: '' }; - var foo = ""; + var foo = ''; var self = this; self.data; - var str = ""; + var str = ''; }; function Test2() { var x = 1; diff --git a/crates/swc/tests/tsc-references/typesWithOptionalProperty.1.normal.js b/crates/swc/tests/tsc-references/typesWithOptionalProperty.1.normal.js index 53e8adb774e2..83a9a8ffa048 100644 --- a/crates/swc/tests/tsc-references/typesWithOptionalProperty.1.normal.js +++ b/crates/swc/tests/tsc-references/typesWithOptionalProperty.1.normal.js @@ -2,17 +2,17 @@ // basic uses of optional properties without errors var a; var b = { - foo: "" + foo: '' }; var c = { - foo: "", + foo: '', bar: 3 }; var d = { - foo: "", + foo: '', bar: 3, baz: function() { - return ""; + return ''; } }; var i; diff --git a/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures.1.normal.js b/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures.1.normal.js index a015b2adda9f..97a35ac7d5bd 100644 --- a/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures.1.normal.js +++ b/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures.1.normal.js @@ -47,6 +47,6 @@ i = c; i = a; a = c; a = i; -var r1 = c.foo("hi"); -var r2 = c.foo("bye"); -var r3 = c.foo("hm"); +var r1 = c.foo('hi'); +var r2 = c.foo('bye'); +var r3 = c.foo('hm'); diff --git a/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures.2.minified.js b/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures.2.minified.js index e12b8bd10480..b7be5178624e 100644 --- a/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures.2.minified.js +++ b/crates/swc/tests/tsc-references/typesWithSpecializedCallSignatures.2.minified.js @@ -10,4 +10,4 @@ var i, a, c = new (function() { return x; }, C; }())(); -c = i, i = c = a, i = a, a = c, a = i, c.foo("hi"), c.foo("bye"), c.foo("hm"); +c = i, i = c = a, i = a, a = c, a = i, c.foo('hi'), c.foo('bye'), c.foo('hm'); diff --git a/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures.1.normal.js b/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures.1.normal.js index c3a4e43af58c..50497a45c6c4 100644 --- a/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures.1.normal.js +++ b/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures.1.normal.js @@ -32,13 +32,13 @@ var C = function C(x) { _class_call_check(this, C); return x; }; -var c = new C("a"); +var c = new C('a'); var i; var a; c = i; c = a; i = a; a = i; -var r1 = new C("hi"); -var r2 = new i("bye"); -var r3 = new a("hm"); +var r1 = new C('hi'); +var r2 = new i('bye'); +var r3 = new a('hm'); diff --git a/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures.2.minified.js b/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures.2.minified.js index f33d03fae553..62597ccf64ff 100644 --- a/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures.2.minified.js +++ b/crates/swc/tests/tsc-references/typesWithSpecializedConstructSignatures.2.minified.js @@ -5,4 +5,4 @@ import { _ as _create_super } from "@swc/helpers/_/_create_super"; var i, a, C = function C(x) { return _class_call_check(this, C), x; }; -new C("a"), a = i = a, new C("hi"), new i("bye"), new a("hm"); +new C('a'), a = i = a, new C('hi'), new i('bye'), new a('hm'); diff --git a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings01_ES5.1.normal.js b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings01_ES5.1.normal.js index 181335899776..4828e51d5755 100644 --- a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings01_ES5.1.normal.js +++ b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings01_ES5.1.normal.js @@ -1,2 +1,2 @@ //// [unicodeExtendedEscapesInStrings01_ES5.ts] -var x = "\0"; +var x = "\u{0}"; diff --git a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings02_ES5.1.normal.js b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings02_ES5.1.normal.js index 990b892de180..db181fd694d1 100644 --- a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings02_ES5.1.normal.js +++ b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings02_ES5.1.normal.js @@ -1,2 +1,2 @@ //// [unicodeExtendedEscapesInStrings02_ES5.ts] -var x = "\0"; +var x = "\u{00}"; diff --git a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings03_ES5.1.normal.js b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings03_ES5.1.normal.js index 3985c0f803f6..2ef482f8c320 100644 --- a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings03_ES5.1.normal.js +++ b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings03_ES5.1.normal.js @@ -1,2 +1,2 @@ //// [unicodeExtendedEscapesInStrings03_ES5.ts] -var x = "\0"; +var x = "\u{0000}"; diff --git a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings04_ES5.1.normal.js b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings04_ES5.1.normal.js index 8ee8ca019dc2..9a3710e709d2 100644 --- a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings04_ES5.1.normal.js +++ b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings04_ES5.1.normal.js @@ -1,2 +1,2 @@ //// [unicodeExtendedEscapesInStrings04_ES5.ts] -var x = "\0"; +var x = "\u{00000000}"; diff --git a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings05_ES5.1.normal.js b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings05_ES5.1.normal.js index ba5d041e11da..50a1099a343b 100644 --- a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings05_ES5.1.normal.js +++ b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings05_ES5.1.normal.js @@ -1,2 +1,2 @@ //// [unicodeExtendedEscapesInStrings05_ES5.ts] -var x = "Hello world"; +var x = "\u{48}\u{65}\u{6c}\u{6c}\u{6f}\u{20}\u{77}\u{6f}\u{72}\u{6c}\u{64}"; diff --git a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings06_ES5.1.normal.js b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings06_ES5.1.normal.js index 6e2c8d448ce2..876777fc86c3 100644 --- a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings06_ES5.1.normal.js +++ b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings06_ES5.1.normal.js @@ -1,4 +1,4 @@ //// [unicodeExtendedEscapesInStrings06_ES5.ts] // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 1. Assert: 0 ≤ cp ≤ 0x10FFFF. -var x = "\uDBFF\uDFFF"; +var x = "\u{10FFFF}"; diff --git a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings08_ES5.1.normal.js b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings08_ES5.1.normal.js index 321d6af5743d..e48241dca8bd 100644 --- a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings08_ES5.1.normal.js +++ b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings08_ES5.1.normal.js @@ -2,4 +2,4 @@ // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. If cp ≤ 65535, return cp. // (FFFF == 65535) -var x = "￿"; +var x = "\u{FFFF}"; diff --git a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings09_ES5.1.normal.js b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings09_ES5.1.normal.js index 79c35b9bbfe0..63ff15a6f016 100644 --- a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings09_ES5.1.normal.js +++ b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings09_ES5.1.normal.js @@ -2,4 +2,4 @@ // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. If cp ≤ 65535, return cp. // (10000 == 65536) -var x = "\uD800\uDC00"; +var x = "\u{10000}"; diff --git a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings13_ES5.1.normal.js b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings13_ES5.1.normal.js index 73a41f6d3f2a..ab29f0c61f8e 100644 --- a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings13_ES5.1.normal.js +++ b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings13_ES5.1.normal.js @@ -1,2 +1,2 @@ //// [unicodeExtendedEscapesInStrings13_ES5.ts] -var x = "\uDB37\uDDDD"; +var x = "\u{DDDDD}"; diff --git a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings15_ES5.1.normal.js b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings15_ES5.1.normal.js index 5d35bfa59780..29a46fb0b52c 100644 --- a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings15_ES5.1.normal.js +++ b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings15_ES5.1.normal.js @@ -1,2 +1,2 @@ //// [unicodeExtendedEscapesInStrings15_ES5.ts] -var x = "ꯍ㑖碐"; +var x = "\u{abcd}\u{ef12}\u{3456}\u{7890}"; diff --git a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings16_ES5.1.normal.js b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings16_ES5.1.normal.js index 037148ac9c50..775e33b08b4e 100644 --- a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings16_ES5.1.normal.js +++ b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings16_ES5.1.normal.js @@ -1,2 +1,2 @@ //// [unicodeExtendedEscapesInStrings16_ES5.ts] -var x = "ꯍ㑖碐"; +var x = "\u{ABCD}\u{EF12}\u{3456}\u{7890}"; diff --git a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings18_ES5.1.normal.js b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings18_ES5.1.normal.js index dcbb7fc62e79..02a8d4267b29 100644 --- a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings18_ES5.1.normal.js +++ b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings18_ES5.1.normal.js @@ -1,2 +1,2 @@ //// [unicodeExtendedEscapesInStrings18_ES5.ts] -var x = "ee"; +var x = "\u{65}\u{65}"; diff --git a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings23_ES5.1.normal.js b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings23_ES5.1.normal.js index 25b326a2bdc2..2e4466aec7c3 100644 --- a/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings23_ES5.1.normal.js +++ b/crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings23_ES5.1.normal.js @@ -1,2 +1,2 @@ //// [unicodeExtendedEscapesInStrings23_ES5.ts] -var x = "g"; +var x = "\u{00000000000067}"; diff --git a/crates/swc/tests/tsc-references/unionTypeCallSignatures.1.normal.js b/crates/swc/tests/tsc-references/unionTypeCallSignatures.1.normal.js index 13fa89f6d24b..63f7fabf0d41 100644 --- a/crates/swc/tests/tsc-references/unionTypeCallSignatures.1.normal.js +++ b/crates/swc/tests/tsc-references/unionTypeCallSignatures.1.normal.js @@ -26,37 +26,37 @@ unionWithDifferentParameterCount(); // needs more args unionWithDifferentParameterCount("hello"); // needs more args unionWithDifferentParameterCount("hello", 10); // OK var unionWithOptionalParameter1; -strOrNum = unionWithOptionalParameter1("hello"); -strOrNum = unionWithOptionalParameter1("hello", 10); -strOrNum = unionWithOptionalParameter1("hello", "hello"); // error in parameter type +strOrNum = unionWithOptionalParameter1('hello'); +strOrNum = unionWithOptionalParameter1('hello', 10); +strOrNum = unionWithOptionalParameter1('hello', "hello"); // error in parameter type strOrNum = unionWithOptionalParameter1(); // error var unionWithOptionalParameter2; -strOrNum = unionWithOptionalParameter2("hello"); // error no call signature -strOrNum = unionWithOptionalParameter2("hello", 10); // error no call signature -strOrNum = unionWithOptionalParameter2("hello", "hello"); // error no call signature +strOrNum = unionWithOptionalParameter2('hello'); // error no call signature +strOrNum = unionWithOptionalParameter2('hello', 10); // error no call signature +strOrNum = unionWithOptionalParameter2('hello', "hello"); // error no call signature strOrNum = unionWithOptionalParameter2(); // error no call signature var unionWithOptionalParameter3; -strOrNum = unionWithOptionalParameter3("hello"); -strOrNum = unionWithOptionalParameter3("hello", 10); // ok -strOrNum = unionWithOptionalParameter3("hello", "hello"); // wrong argument type +strOrNum = unionWithOptionalParameter3('hello'); +strOrNum = unionWithOptionalParameter3('hello', 10); // ok +strOrNum = unionWithOptionalParameter3('hello', "hello"); // wrong argument type strOrNum = unionWithOptionalParameter3(); // needs more args var unionWithRestParameter1; -strOrNum = unionWithRestParameter1("hello"); -strOrNum = unionWithRestParameter1("hello", 10); -strOrNum = unionWithRestParameter1("hello", 10, 11); -strOrNum = unionWithRestParameter1("hello", "hello"); // error in parameter type +strOrNum = unionWithRestParameter1('hello'); +strOrNum = unionWithRestParameter1('hello', 10); +strOrNum = unionWithRestParameter1('hello', 10, 11); +strOrNum = unionWithRestParameter1('hello', "hello"); // error in parameter type strOrNum = unionWithRestParameter1(); // error var unionWithRestParameter2; -strOrNum = unionWithRestParameter2("hello"); // error no call signature -strOrNum = unionWithRestParameter2("hello", 10); // error no call signature -strOrNum = unionWithRestParameter2("hello", 10, 11); // error no call signature -strOrNum = unionWithRestParameter2("hello", "hello"); // error no call signature +strOrNum = unionWithRestParameter2('hello'); // error no call signature +strOrNum = unionWithRestParameter2('hello', 10); // error no call signature +strOrNum = unionWithRestParameter2('hello', 10, 11); // error no call signature +strOrNum = unionWithRestParameter2('hello', "hello"); // error no call signature strOrNum = unionWithRestParameter2(); // error no call signature var unionWithRestParameter3; -strOrNum = unionWithRestParameter3("hello"); -strOrNum = unionWithRestParameter3("hello", 10); // error no call signature -strOrNum = unionWithRestParameter3("hello", 10, 11); // error no call signature -strOrNum = unionWithRestParameter3("hello", "hello"); // wrong argument type +strOrNum = unionWithRestParameter3('hello'); +strOrNum = unionWithRestParameter3('hello', 10); // error no call signature +strOrNum = unionWithRestParameter3('hello', 10, 11); // error no call signature +strOrNum = unionWithRestParameter3('hello', "hello"); // wrong argument type strOrNum = unionWithRestParameter3(); // error no call signature var unionWithRestParameter4; strOrNum = unionWithRestParameter4("hello"); // error supplied parameters do not match any call signature diff --git a/crates/swc/tests/tsc-references/unionTypeCallSignatures.2.minified.js b/crates/swc/tests/tsc-references/unionTypeCallSignatures.2.minified.js index c0b8c965037b..bd0a508179a8 100644 --- a/crates/swc/tests/tsc-references/unionTypeCallSignatures.2.minified.js +++ b/crates/swc/tests/tsc-references/unionTypeCallSignatures.2.minified.js @@ -1,3 +1,3 @@ //// [unionTypeCallSignatures.ts] var unionOfDifferentReturnType, unionOfDifferentReturnType1, unionOfDifferentParameterTypes, unionOfDifferentNumberOfSignatures, unionWithDifferentParameterCount, unionWithOptionalParameter1, unionWithOptionalParameter2, unionWithOptionalParameter3, unionWithRestParameter1, unionWithRestParameter2, unionWithRestParameter3, unionWithRestParameter4; -unionOfDifferentReturnType(10), unionOfDifferentReturnType("hello"), unionOfDifferentReturnType1(!0), unionOfDifferentReturnType1(10), unionOfDifferentReturnType1("hello"), unionOfDifferentReturnType1(!0), unionOfDifferentReturnType1(), unionOfDifferentParameterTypes(10), unionOfDifferentParameterTypes("hello"), unionOfDifferentParameterTypes(), unionOfDifferentNumberOfSignatures(), unionOfDifferentNumberOfSignatures(10), unionOfDifferentNumberOfSignatures("hello"), unionWithDifferentParameterCount(), unionWithDifferentParameterCount("hello"), unionWithDifferentParameterCount("hello", 10), unionWithOptionalParameter1("hello"), unionWithOptionalParameter1("hello", 10), unionWithOptionalParameter1("hello", "hello"), unionWithOptionalParameter1(), unionWithOptionalParameter2("hello"), unionWithOptionalParameter2("hello", 10), unionWithOptionalParameter2("hello", "hello"), unionWithOptionalParameter2(), unionWithOptionalParameter3("hello"), unionWithOptionalParameter3("hello", 10), unionWithOptionalParameter3("hello", "hello"), unionWithOptionalParameter3(), unionWithRestParameter1("hello"), unionWithRestParameter1("hello", 10), unionWithRestParameter1("hello", 10, 11), unionWithRestParameter1("hello", "hello"), unionWithRestParameter1(), unionWithRestParameter2("hello"), unionWithRestParameter2("hello", 10), unionWithRestParameter2("hello", 10, 11), unionWithRestParameter2("hello", "hello"), unionWithRestParameter2(), unionWithRestParameter3("hello"), unionWithRestParameter3("hello", 10), unionWithRestParameter3("hello", 10, 11), unionWithRestParameter3("hello", "hello"), unionWithRestParameter3(), unionWithRestParameter4("hello"), unionWithRestParameter4("hello", "world"); +unionOfDifferentReturnType(10), unionOfDifferentReturnType("hello"), unionOfDifferentReturnType1(!0), unionOfDifferentReturnType1(10), unionOfDifferentReturnType1("hello"), unionOfDifferentReturnType1(!0), unionOfDifferentReturnType1(), unionOfDifferentParameterTypes(10), unionOfDifferentParameterTypes("hello"), unionOfDifferentParameterTypes(), unionOfDifferentNumberOfSignatures(), unionOfDifferentNumberOfSignatures(10), unionOfDifferentNumberOfSignatures("hello"), unionWithDifferentParameterCount(), unionWithDifferentParameterCount("hello"), unionWithDifferentParameterCount("hello", 10), unionWithOptionalParameter1('hello'), unionWithOptionalParameter1('hello', 10), unionWithOptionalParameter1('hello', "hello"), unionWithOptionalParameter1(), unionWithOptionalParameter2('hello'), unionWithOptionalParameter2('hello', 10), unionWithOptionalParameter2('hello', "hello"), unionWithOptionalParameter2(), unionWithOptionalParameter3('hello'), unionWithOptionalParameter3('hello', 10), unionWithOptionalParameter3('hello', "hello"), unionWithOptionalParameter3(), unionWithRestParameter1('hello'), unionWithRestParameter1('hello', 10), unionWithRestParameter1('hello', 10, 11), unionWithRestParameter1('hello', "hello"), unionWithRestParameter1(), unionWithRestParameter2('hello'), unionWithRestParameter2('hello', 10), unionWithRestParameter2('hello', 10, 11), unionWithRestParameter2('hello', "hello"), unionWithRestParameter2(), unionWithRestParameter3('hello'), unionWithRestParameter3('hello', 10), unionWithRestParameter3('hello', 10, 11), unionWithRestParameter3('hello', "hello"), unionWithRestParameter3(), unionWithRestParameter4("hello"), unionWithRestParameter4("hello", "world"); diff --git a/crates/swc/tests/tsc-references/unionTypeConstructSignatures.1.normal.js b/crates/swc/tests/tsc-references/unionTypeConstructSignatures.1.normal.js index 585b952f1c94..039a9f391db3 100644 --- a/crates/swc/tests/tsc-references/unionTypeConstructSignatures.1.normal.js +++ b/crates/swc/tests/tsc-references/unionTypeConstructSignatures.1.normal.js @@ -26,37 +26,37 @@ new unionWithDifferentParameterCount(); // needs more args new unionWithDifferentParameterCount("hello"); // needs more args new unionWithDifferentParameterCount("hello", 10); // ok var unionWithOptionalParameter1; -strOrNum = new unionWithOptionalParameter1("hello"); -strOrNum = new unionWithOptionalParameter1("hello", 10); -strOrNum = new unionWithOptionalParameter1("hello", "hello"); // error in parameter type +strOrNum = new unionWithOptionalParameter1('hello'); +strOrNum = new unionWithOptionalParameter1('hello', 10); +strOrNum = new unionWithOptionalParameter1('hello', "hello"); // error in parameter type strOrNum = new unionWithOptionalParameter1(); // error var unionWithOptionalParameter2; -strOrNum = new unionWithOptionalParameter2("hello"); // error no call signature -strOrNum = new unionWithOptionalParameter2("hello", 10); // error no call signature -strOrNum = new unionWithOptionalParameter2("hello", "hello"); // error no call signature +strOrNum = new unionWithOptionalParameter2('hello'); // error no call signature +strOrNum = new unionWithOptionalParameter2('hello', 10); // error no call signature +strOrNum = new unionWithOptionalParameter2('hello', "hello"); // error no call signature strOrNum = new unionWithOptionalParameter2(); // error no call signature var unionWithOptionalParameter3; -strOrNum = new unionWithOptionalParameter3("hello"); // error no call signature -strOrNum = new unionWithOptionalParameter3("hello", 10); // ok -strOrNum = new unionWithOptionalParameter3("hello", "hello"); // wrong type +strOrNum = new unionWithOptionalParameter3('hello'); // error no call signature +strOrNum = new unionWithOptionalParameter3('hello', 10); // ok +strOrNum = new unionWithOptionalParameter3('hello', "hello"); // wrong type strOrNum = new unionWithOptionalParameter3(); // error no call signature var unionWithRestParameter1; -strOrNum = new unionWithRestParameter1("hello"); -strOrNum = new unionWithRestParameter1("hello", 10); -strOrNum = new unionWithRestParameter1("hello", 10, 11); -strOrNum = new unionWithRestParameter1("hello", "hello"); // error in parameter type +strOrNum = new unionWithRestParameter1('hello'); +strOrNum = new unionWithRestParameter1('hello', 10); +strOrNum = new unionWithRestParameter1('hello', 10, 11); +strOrNum = new unionWithRestParameter1('hello', "hello"); // error in parameter type strOrNum = new unionWithRestParameter1(); // error var unionWithRestParameter2; -strOrNum = new unionWithRestParameter2("hello"); // error no call signature -strOrNum = new unionWithRestParameter2("hello", 10); // error no call signature -strOrNum = new unionWithRestParameter2("hello", 10, 11); // error no call signature -strOrNum = new unionWithRestParameter2("hello", "hello"); // error no call signature +strOrNum = new unionWithRestParameter2('hello'); // error no call signature +strOrNum = new unionWithRestParameter2('hello', 10); // error no call signature +strOrNum = new unionWithRestParameter2('hello', 10, 11); // error no call signature +strOrNum = new unionWithRestParameter2('hello', "hello"); // error no call signature strOrNum = new unionWithRestParameter2(); // error no call signature var unionWithRestParameter3; -strOrNum = new unionWithRestParameter3("hello"); // error no call signature -strOrNum = new unionWithRestParameter3("hello", 10); // ok -strOrNum = new unionWithRestParameter3("hello", 10, 11); // ok -strOrNum = new unionWithRestParameter3("hello", "hello"); // wrong type +strOrNum = new unionWithRestParameter3('hello'); // error no call signature +strOrNum = new unionWithRestParameter3('hello', 10); // ok +strOrNum = new unionWithRestParameter3('hello', 10, 11); // ok +strOrNum = new unionWithRestParameter3('hello', "hello"); // wrong type strOrNum = new unionWithRestParameter3(); // error no call signature var unionWithAbstractSignature; -new unionWithAbstractSignature("hello"); +new unionWithAbstractSignature('hello'); diff --git a/crates/swc/tests/tsc-references/unionTypeConstructSignatures.2.minified.js b/crates/swc/tests/tsc-references/unionTypeConstructSignatures.2.minified.js index ebceef51bcaf..6ebeb44feef8 100644 --- a/crates/swc/tests/tsc-references/unionTypeConstructSignatures.2.minified.js +++ b/crates/swc/tests/tsc-references/unionTypeConstructSignatures.2.minified.js @@ -1,3 +1,3 @@ //// [unionTypeConstructSignatures.ts] var unionOfDifferentReturnType, unionOfDifferentReturnType1, unionOfDifferentParameterTypes, unionOfDifferentNumberOfSignatures, unionWithDifferentParameterCount, unionWithOptionalParameter1, unionWithOptionalParameter2, unionWithOptionalParameter3, unionWithRestParameter1, unionWithRestParameter2, unionWithRestParameter3, unionWithAbstractSignature; -new unionOfDifferentReturnType(10), new unionOfDifferentReturnType("hello"), new unionOfDifferentReturnType1(!0), new unionOfDifferentReturnType1(10), new unionOfDifferentReturnType1("hello"), new unionOfDifferentReturnType1(!0), new unionOfDifferentReturnType1(), new unionOfDifferentParameterTypes(10), new unionOfDifferentParameterTypes("hello"), new unionOfDifferentParameterTypes(), new unionOfDifferentNumberOfSignatures(), new unionOfDifferentNumberOfSignatures(10), new unionOfDifferentNumberOfSignatures("hello"), new unionWithDifferentParameterCount(), new unionWithDifferentParameterCount("hello"), new unionWithDifferentParameterCount("hello", 10), new unionWithOptionalParameter1("hello"), new unionWithOptionalParameter1("hello", 10), new unionWithOptionalParameter1("hello", "hello"), new unionWithOptionalParameter1(), new unionWithOptionalParameter2("hello"), new unionWithOptionalParameter2("hello", 10), new unionWithOptionalParameter2("hello", "hello"), new unionWithOptionalParameter2(), new unionWithOptionalParameter3("hello"), new unionWithOptionalParameter3("hello", 10), new unionWithOptionalParameter3("hello", "hello"), new unionWithOptionalParameter3(), new unionWithRestParameter1("hello"), new unionWithRestParameter1("hello", 10), new unionWithRestParameter1("hello", 10, 11), new unionWithRestParameter1("hello", "hello"), new unionWithRestParameter1(), new unionWithRestParameter2("hello"), new unionWithRestParameter2("hello", 10), new unionWithRestParameter2("hello", 10, 11), new unionWithRestParameter2("hello", "hello"), new unionWithRestParameter2(), new unionWithRestParameter3("hello"), new unionWithRestParameter3("hello", 10), new unionWithRestParameter3("hello", 10, 11), new unionWithRestParameter3("hello", "hello"), new unionWithRestParameter3(), new unionWithAbstractSignature("hello"); +new unionOfDifferentReturnType(10), new unionOfDifferentReturnType("hello"), new unionOfDifferentReturnType1(!0), new unionOfDifferentReturnType1(10), new unionOfDifferentReturnType1("hello"), new unionOfDifferentReturnType1(!0), new unionOfDifferentReturnType1(), new unionOfDifferentParameterTypes(10), new unionOfDifferentParameterTypes("hello"), new unionOfDifferentParameterTypes(), new unionOfDifferentNumberOfSignatures(), new unionOfDifferentNumberOfSignatures(10), new unionOfDifferentNumberOfSignatures("hello"), new unionWithDifferentParameterCount(), new unionWithDifferentParameterCount("hello"), new unionWithDifferentParameterCount("hello", 10), new unionWithOptionalParameter1('hello'), new unionWithOptionalParameter1('hello', 10), new unionWithOptionalParameter1('hello', "hello"), new unionWithOptionalParameter1(), new unionWithOptionalParameter2('hello'), new unionWithOptionalParameter2('hello', 10), new unionWithOptionalParameter2('hello', "hello"), new unionWithOptionalParameter2(), new unionWithOptionalParameter3('hello'), new unionWithOptionalParameter3('hello', 10), new unionWithOptionalParameter3('hello', "hello"), new unionWithOptionalParameter3(), new unionWithRestParameter1('hello'), new unionWithRestParameter1('hello', 10), new unionWithRestParameter1('hello', 10, 11), new unionWithRestParameter1('hello', "hello"), new unionWithRestParameter1(), new unionWithRestParameter2('hello'), new unionWithRestParameter2('hello', 10), new unionWithRestParameter2('hello', 10, 11), new unionWithRestParameter2('hello', "hello"), new unionWithRestParameter2(), new unionWithRestParameter3('hello'), new unionWithRestParameter3('hello', 10), new unionWithRestParameter3('hello', 10, 11), new unionWithRestParameter3('hello', "hello"), new unionWithRestParameter3(), new unionWithAbstractSignature('hello'); diff --git a/crates/swc/tests/tsc-references/unionTypeReduction2.1.normal.js b/crates/swc/tests/tsc-references/unionTypeReduction2.1.normal.js index 27dd723f84ae..88bd3f0a4245 100644 --- a/crates/swc/tests/tsc-references/unionTypeReduction2.1.normal.js +++ b/crates/swc/tests/tsc-references/unionTypeReduction2.1.normal.js @@ -2,37 +2,37 @@ function f1(x, y) { var z = !!true ? x : y; // { f(x?: string): void } z.f(); - z.f("hello"); + z.f('hello'); } function f2(x, y) { var z = !!true ? x : y; // { f(x?: string): void } z.f(); - z.f("hello"); + z.f('hello'); } function f3(x, y) { var f = !!true ? x : y; // (x?: string) => void f(); - f("hello"); + f('hello'); } function f4(x, y) { var f = !!true ? x : y; // (x?: string) => void f(); - f("hello"); + f('hello'); } function f5(x, y) { var f = !!true ? x : y; // (x?: 'hello') => void f(); - f("hello"); + f('hello'); } function f6(x, y) { var f = !!true ? x : y; // (x: 'hello' | undefined) => void f(); // Error - f("hello"); + f('hello'); } function f11(a, b) { var z = !!true ? a : b; // A | B z.f(); - z.f("hello"); + z.f('hello'); } var k = { something: function something() {} @@ -40,5 +40,5 @@ var k = { function run(options) { var _options_something; var something = (_options_something = options.something) !== null && _options_something !== void 0 ? _options_something : val.something; - something(""); + something(''); } diff --git a/crates/swc/tests/tsc-references/unknownControlFlow.1.normal.js b/crates/swc/tests/tsc-references/unknownControlFlow.1.normal.js index 253d9aef0b4d..8d307320f6ee 100644 --- a/crates/swc/tests/tsc-references/unknownControlFlow.1.normal.js +++ b/crates/swc/tests/tsc-references/unknownControlFlow.1.normal.js @@ -189,7 +189,7 @@ function f41(a) { } // Repro from #48468 function deepEquals(a, b) { - if (typeof a !== "object" || typeof b !== "object" || !a || !b) { + if (typeof a !== 'object' || typeof b !== 'object' || !a || !b) { return false; } if (Array.isArray(a) || Array.isArray(b)) { @@ -222,10 +222,10 @@ function ff3(t, k) { function ff4(t, k) { t[k]; } -ff1(null, "foo"); // Error -ff2(null, "foo"); // Error -ff3(null, "foo"); -ff4(null, "foo"); // Error +ff1(null, 'foo'); // Error +ff2(null, 'foo'); // Error +ff3(null, 'foo'); +ff4(null, 'foo'); // Error // Generics and intersections with {} function fx0(value) { if (value === 42) { @@ -284,8 +284,8 @@ function fx10(x, y) { } // Repros from #50706 function SendBlob(encoding) { - if (encoding !== undefined && encoding !== "utf8") { - throw new Error("encoding"); + if (encoding !== undefined && encoding !== 'utf8') { + throw new Error('encoding'); } encoding; } @@ -294,7 +294,7 @@ function doSomething1(value) { return value; } if (value === 42) { - throw Error("Meaning of life value"); + throw Error('Meaning of life value'); } return value; } @@ -310,12 +310,12 @@ function x(x, y) { var r2 = y; } function assertNever(v) { - throw new Error("never"); + throw new Error('never'); } function fx20(value) { - if (value === "left") { + if (value === 'left') { var foo = value; - } else if (value === "right") { + } else if (value === 'right') { var bar = value; } else { assertNever(value); diff --git a/crates/swc/tests/tsc-references/unknownType2.1.normal.js b/crates/swc/tests/tsc-references/unknownType2.1.normal.js index 6940daefcd05..1e2cb35034c3 100644 --- a/crates/swc/tests/tsc-references/unknownType2.1.normal.js +++ b/crates/swc/tests/tsc-references/unknownType2.1.normal.js @@ -1,6 +1,6 @@ //// [unknownType2.ts] var validate = function(x) { - return x === "yes" || x === "no" ? x : "idk"; + return x === 'yes' || x === 'no' ? x : 'idk'; }; // No error var u = undefined; if (u === 5) { @@ -139,27 +139,27 @@ function switchTestObjects(x, y, z) { } function switchResponse(x) { switch(x){ - case "yes": - case "no": - case "idk": + case 'yes': + case 'no': + case 'idk': return x; default: - throw new Error("unknown response"); + throw new Error('unknown response'); } } function switchResponseWrong(x) { switch(x){ - case "yes": - case "no": - case "maybe": + case 'yes': + case 'no': + case 'maybe': return x; // error default: - throw new Error("Can you repeat the question?"); + throw new Error('Can you repeat the question?'); } } // Repro from #33483 function f2(x) { - if (x !== undefined && typeof x !== "string") { + if (x !== undefined && typeof x !== 'string') { throw new Error(); } return x; diff --git a/crates/swc/tests/tsc-references/validMultipleVariableDeclarations.1.normal.js b/crates/swc/tests/tsc-references/validMultipleVariableDeclarations.1.normal.js index c4dc937d05cf..263f6f3473bd 100644 --- a/crates/swc/tests/tsc-references/validMultipleVariableDeclarations.1.normal.js +++ b/crates/swc/tests/tsc-references/validMultipleVariableDeclarations.1.normal.js @@ -9,7 +9,7 @@ if (true) { var x = undefined; // new declaration space, making redeclaring x as a string valid function declSpace() { - var x = "this is a string"; + var x = 'this is a string'; } var p; var p = { @@ -45,8 +45,8 @@ var fn = null; var fn; var a; var a = [ - "a", - "b" + 'a', + 'b' ]; var a = []; var a = []; diff --git a/crates/swc/tests/tsc-references/validStringAssignments.1.normal.js b/crates/swc/tests/tsc-references/validStringAssignments.1.normal.js index a7af2e180863..c9c101778f08 100644 --- a/crates/swc/tests/tsc-references/validStringAssignments.1.normal.js +++ b/crates/swc/tests/tsc-references/validStringAssignments.1.normal.js @@ -1,5 +1,5 @@ //// [validStringAssignments.ts] -var x = ""; +var x = ''; var a = x; var b = x; var c = x; diff --git a/crates/swc/tests/tsc-references/varRequireFromJavascript.1.normal.js b/crates/swc/tests/tsc-references/varRequireFromJavascript.1.normal.js index 1bb61704233f..3d3159f6ca20 100644 --- a/crates/swc/tests/tsc-references/varRequireFromJavascript.1.normal.js +++ b/crates/swc/tests/tsc-references/varRequireFromJavascript.1.normal.js @@ -13,7 +13,7 @@ export var Crunch = /*#__PURE__*/ function() { return Crunch; }(); //// [use.js] -var ex = require("./ex"); +var ex = require('./ex'); // values work var crunch = new ex.Crunch(1); crunch.n; diff --git a/crates/swc/tests/tsc-references/varRequireFromJavascript.2.minified.js b/crates/swc/tests/tsc-references/varRequireFromJavascript.2.minified.js index 49e4378f44b4..bbf441a48eea 100644 --- a/crates/swc/tests/tsc-references/varRequireFromJavascript.2.minified.js +++ b/crates/swc/tests/tsc-references/varRequireFromJavascript.2.minified.js @@ -9,4 +9,4 @@ export var Crunch = function() { }, Crunch; }(); //// [use.js] -new (require("./ex")).Crunch(1).n; +new (require('./ex')).Crunch(1).n; diff --git a/crates/swc/tests/tsc-references/varRequireFromTypescript.1.normal.js b/crates/swc/tests/tsc-references/varRequireFromTypescript.1.normal.js index 2235de5885f4..a9714085083c 100644 --- a/crates/swc/tests/tsc-references/varRequireFromTypescript.1.normal.js +++ b/crates/swc/tests/tsc-references/varRequireFromTypescript.1.normal.js @@ -5,7 +5,7 @@ export var Crunch = function Crunch() { _class_call_check(this, Crunch); }; //// [use.js] -var ex = require("./ex"); +var ex = require('./ex'); // values work var crunch = new ex.Crunch(1); crunch.n; diff --git a/crates/swc/tests/tsc-references/varRequireFromTypescript.2.minified.js b/crates/swc/tests/tsc-references/varRequireFromTypescript.2.minified.js index e846770a3d48..4e4ac1392e28 100644 --- a/crates/swc/tests/tsc-references/varRequireFromTypescript.2.minified.js +++ b/crates/swc/tests/tsc-references/varRequireFromTypescript.2.minified.js @@ -4,4 +4,4 @@ export var Crunch = function Crunch() { _class_call_check(this, Crunch); }; //// [use.js] -new (require("./ex")).Crunch(1).n; +new (require('./ex')).Crunch(1).n; diff --git a/crates/swc/tests/tsc-references/variadicTuples1.1.normal.js b/crates/swc/tests/tsc-references/variadicTuples1.1.normal.js index b605a35b26be..6f31817c4243 100644 --- a/crates/swc/tests/tsc-references/variadicTuples1.1.normal.js +++ b/crates/swc/tests/tsc-references/variadicTuples1.1.normal.js @@ -13,7 +13,7 @@ function tup2(t, u) { ]); } var t2 = tup2([ - "hello" + 'hello' ], [ 10, true @@ -23,7 +23,7 @@ function concat(t, u) { } var tc1 = concat([], []); var tc2 = concat([ - "hello" + 'hello' ], [ 42 ]); @@ -50,7 +50,7 @@ var tc5 = concat2([ 6 ]); // (1 | 2 | 3 | 4 | 5 | 6)[] function foo2(t1, t2, a1) { - foo1(1, "abc", true, 42, 43, 44); + foo1(1, 'abc', true, 42, 43, 44); foo1.apply(void 0, _to_consumable_array(t1).concat([ true, 42, @@ -70,29 +70,29 @@ function foo2(t1, t2, a1) { } function foo4(u) { foo3(1, 2); - foo3(1, "hello", true, 2); + foo3(1, 'hello', true, 2); foo3.apply(void 0, [ 1 ].concat(_to_consumable_array(u), [ - "hi", + 'hi', 2 ])); foo3(1); } ft1([ - "hello", + 'hello', 42 ]); // (string | number)[] ft2([ - "hello", + 'hello', 42 ]); // readonly (string | number)[] ft3([ - "hello", + 'hello', 42 ]); // [string, number] ft4([ - "hello", + 'hello', 42 ]); // readonly [string, number] // Indexing variadic tuple types @@ -121,7 +121,7 @@ function f3(t) { } var tm1 = fm1([ [ - "abc" + 'abc' ], [ 42 @@ -130,37 +130,37 @@ var tm1 = fm1([ true ], [ - "def" + 'def' ] ]); // [boolean, string] function gx1(u, v) { - fx1("abc"); // [] + fx1('abc'); // [] fx1.apply(void 0, [ - "abc" + 'abc' ].concat(_to_consumable_array(u))); // U fx1.apply(void 0, [ - "abc" + 'abc' ].concat(_to_consumable_array(v))); // [...V] fx1.apply(void 0, [ - "abc" + 'abc' ].concat(_to_consumable_array(u))); // U fx1.apply(void 0, [ - "abc" + 'abc' ].concat(_to_consumable_array(v))); // Error } function gx2(u, v) { - fx2("abc"); // [] + fx2('abc'); // [] fx2.apply(void 0, [ - "abc" + 'abc' ].concat(_to_consumable_array(u))); // U fx2.apply(void 0, [ - "abc" + 'abc' ].concat(_to_consumable_array(v))); // [...V] fx2.apply(void 0, [ - "abc" + 'abc' ].concat(_to_consumable_array(u))); // U fx2.apply(void 0, [ - "abc" + 'abc' ].concat(_to_consumable_array(v))); // V } // Relations involving variadic tuple types @@ -207,15 +207,15 @@ function f14(t0, t1, t2) { t2 = t1; // Error } function f15(k0, k1, k2, k3) { - k0 = "length"; - k1 = "length"; - k2 = "length"; - k0 = "slice"; - k1 = "slice"; - k2 = "slice"; - k3 = "0"; - k3 = "1"; - k3 = "2"; // Error + k0 = 'length'; + k1 = 'length'; + k2 = 'length'; + k0 = 'slice'; + k1 = 'slice'; + k2 = 'slice'; + k3 = '0'; + k3 = '1'; + k3 = '2'; // Error } // Constraints of variadic tuple types function ft16(x, y) { @@ -244,11 +244,11 @@ var fn1 = function(a1, b, c, d) { }; var c0 = curry(fn1); // (a: number, b: string, c: boolean, d: string[]) => number var c1 = curry(fn1, 1); // (b: string, c: boolean, d: string[]) => number -var c2 = curry(fn1, 1, "abc"); // (c: boolean, d: string[]) => number -var c3 = curry(fn1, 1, "abc", true); // (d: string[]) => number -var c4 = curry(fn1, 1, "abc", true, [ - "x", - "y" +var c2 = curry(fn1, 1, 'abc'); // (c: boolean, d: string[]) => number +var c3 = curry(fn1, 1, 'abc', true); // (d: string[]) => number +var c4 = curry(fn1, 1, 'abc', true, [ + 'x', + 'y' ]); // () => number var fn2 = function(x, b) { for(var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){ @@ -259,7 +259,7 @@ var fn2 = function(x, b) { var c10 = curry(fn2); // (x: number, b: boolean, ...args: string[]) => number var c11 = curry(fn2, 1); // (b: boolean, ...args: string[]) => number var c12 = curry(fn2, 1, true); // (...args: string[]) => number -var c13 = curry(fn2, 1, true, "abc", "def"); // (...args: string[]) => number +var c13 = curry(fn2, 1, true, 'abc', 'def'); // (...args: string[]) => number var fn3 = function() { for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ args[_key] = arguments[_key]; @@ -267,7 +267,7 @@ var fn3 = function() { return 0; }; var c20 = curry(fn3); // (...args: string[]) => number -var c21 = curry(fn3, "abc", "def"); // (...args: string[]) => number +var c21 = curry(fn3, 'abc', 'def'); // (...args: string[]) => number var c22 = curry.apply(void 0, [ fn3 ].concat(_to_consumable_array(sa))); // (...args: string[]) => number @@ -276,13 +276,13 @@ function curry2(f, t, u) { return f.apply(void 0, _to_consumable_array(t).concat(_to_consumable_array(u))); } curry2(fn10, [ - "hello", + 'hello', 42 ], [ true ]); curry2(fn10, [ - "hello" + 'hello' ], [ 42, true @@ -305,21 +305,21 @@ ft([ 3 ]); ft([ - "a", - "b" + 'a', + 'b' ], [ - "c", - "d" + 'c', + 'd' ]); ft([ - "a", - "b" + 'a', + 'b' ], [ - "c", - "d", + 'c', + 'd', 42 ]); -call("hello", 32, function(a1, b) { +call('hello', 32, function(a1, b) { return 42; }); call.apply(void 0, _to_consumable_array(sa).concat([ diff --git a/crates/swc/tests/tsc-references/variadicTuples1.2.minified.js b/crates/swc/tests/tsc-references/variadicTuples1.2.minified.js index be15fb307f94..c8c68a5ebc1d 100644 --- a/crates/swc/tests/tsc-references/variadicTuples1.2.minified.js +++ b/crates/swc/tests/tsc-references/variadicTuples1.2.minified.js @@ -17,13 +17,13 @@ u = [ ], [ 1 ].concat(_to_consumable_array([ - "hello" + 'hello' ]), [ 2 ], _to_consumable_array(u), [ 3 ]), concat([], []), concat([ - "hello" + 'hello' ], [ 42 ]), concat([ @@ -43,20 +43,20 @@ u = [ 2, 3 ]).concat(_to_consumable_array(u1)), ft1([ - "hello", + 'hello', 42 ]), ft2([ - "hello", + 'hello', 42 ]), ft3([ - "hello", + 'hello', 42 ]), ft4([ - "hello", + 'hello', 42 ]), fm1([ [ - "abc" + 'abc' ], [ 42 @@ -65,21 +65,21 @@ u = [ !0 ], [ - "def" + 'def' ] ]); var u, u1, fn1 = function(a1, b, c, d) { return 0; }; -curry(fn1), curry(fn1, 1), curry(fn1, 1, "abc"), curry(fn1, 1, "abc", !0), curry(fn1, 1, "abc", !0, [ - "x", - "y" +curry(fn1), curry(fn1, 1), curry(fn1, 1, 'abc'), curry(fn1, 1, 'abc', !0), curry(fn1, 1, 'abc', !0, [ + 'x', + 'y' ]); var fn2 = function(x, b) { for(var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)args[_key - 2] = arguments[_key]; return 0; }; -curry(fn2), curry(fn2, 1), curry(fn2, 1, !0), curry(fn2, 1, !0, "abc", "def"); +curry(fn2), curry(fn2, 1), curry(fn2, 1, !0), curry(fn2, 1, !0, 'abc', 'def'); var fn3 = function() { for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key]; return 0; @@ -95,15 +95,15 @@ function callApi(method) { ])); }; } -curry(fn3), curry(fn3, "abc", "def"), curry.apply(void 0, [ +curry(fn3), curry(fn3, 'abc', 'def'), curry.apply(void 0, [ fn3 ].concat(_to_consumable_array(sa))), curry2(fn10, [ - "hello", + 'hello', 42 ], [ !0 ]), curry2(fn10, [ - "hello" + 'hello' ], [ 42, !0 @@ -123,19 +123,19 @@ curry(fn3), curry(fn3, "abc", "def"), curry.apply(void 0, [ 2, 3 ]), ft([ - "a", - "b" + 'a', + 'b' ], [ - "c", - "d" + 'c', + 'd' ]), ft([ - "a", - "b" + 'a', + 'b' ], [ - "c", - "d", + 'c', + 'd', 42 -]), call("hello", 32, function(a1, b) { +]), call('hello', 32, function(a1, b) { return 42; }), call.apply(void 0, _to_consumable_array(sa).concat([ function() { diff --git a/crates/swc/tests/tsc-references/verbatimModuleSyntaxConstEnumUsage.1.normal.js b/crates/swc/tests/tsc-references/verbatimModuleSyntaxConstEnumUsage.1.normal.js index 79cf4c3baf64..8aa0d28b4905 100644 --- a/crates/swc/tests/tsc-references/verbatimModuleSyntaxConstEnumUsage.1.normal.js +++ b/crates/swc/tests/tsc-references/verbatimModuleSyntaxConstEnumUsage.1.normal.js @@ -7,7 +7,7 @@ export var Foo; Foo[Foo["c"] = 3] = "c"; })(Foo || (Foo = {})); //// [bar.ts] -import { Foo } from "./foo.js"; +import { Foo } from './foo.js'; export var Bar; (function(Bar) { Bar[Bar["a"] = Foo.a] = "a"; diff --git a/crates/swc/tests/tsc-references/verbatimModuleSyntaxConstEnumUsage.2.minified.js b/crates/swc/tests/tsc-references/verbatimModuleSyntaxConstEnumUsage.2.minified.js index 0cd1368c02d6..7c351d12e8c3 100644 --- a/crates/swc/tests/tsc-references/verbatimModuleSyntaxConstEnumUsage.2.minified.js +++ b/crates/swc/tests/tsc-references/verbatimModuleSyntaxConstEnumUsage.2.minified.js @@ -6,7 +6,7 @@ export { Foo1 as Foo }; (Foo = Foo1 || (Foo1 = {}))[Foo.a = 1] = "a", Foo[Foo.b = 2] = "b", Foo[Foo.c = 3] = "c"; //// [bar.ts] var Bar; -import { Foo } from "./foo.js"; +import { Foo } from './foo.js'; var Bar1; export { Bar1 as Bar }; (Bar = Bar1 || (Bar1 = {}))[Bar.a = Foo.a] = "a", Bar[Bar.c = Foo.c] = "c", Bar[Bar.e = 5] = "e"; diff --git a/crates/swc/tests/tsc-references/witness.1.normal.js b/crates/swc/tests/tsc-references/witness.1.normal.js index 75b4d87d3d82..91d3389d85e2 100644 --- a/crates/swc/tests/tsc-references/witness.1.normal.js +++ b/crates/swc/tests/tsc-references/witness.1.normal.js @@ -45,19 +45,19 @@ var as2; // Conditional var cnd1 = cnd1 ? 0 : 1; var cnd1; -var cnd2 = cnd1 ? cnd1 ? "" : "" : ""; +var cnd2 = cnd1 ? cnd1 ? '' : "" : ''; var cnd2; // || -var or1 = or1 || ""; +var or1 = or1 || ''; var or1; -var or2 = "" || or2; +var or2 = '' || or2; var or2; var or3 = or3 || or3; var or3; // && -var and1 = and1 && ""; +var and1 = and1 && ''; var and1; -var and2 = "" && and2; +var and2 = '' && and2; var and2; var and3 = and3 && and3; var and3; diff --git a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints2.1.normal.js b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints2.1.normal.js index ecde1fcad339..67cb29c5d3cc 100644 --- a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints2.1.normal.js +++ b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints2.1.normal.js @@ -5,4 +5,4 @@ var C = function C(x) { _class_call_check(this, C); }; var c = new C(1); -var c = new C(new C("")); // error +var c = new C(new C('')); // error diff --git a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints2.2.minified.js b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints2.2.minified.js index 063bc1733ba4..6bf70f8ac6f2 100644 --- a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints2.2.minified.js +++ b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints2.2.minified.js @@ -3,4 +3,4 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; var C = function C(x) { _class_call_check(this, C); }; -new C(1), new C(new C("")); +new C(1), new C(new C('')); diff --git a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints3.1.normal.js b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints3.1.normal.js index 75d9a122493d..d419671882ea 100644 --- a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints3.1.normal.js +++ b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints3.1.normal.js @@ -21,7 +21,7 @@ var c = new C({ var r = c.foo({ length: 3, charAt: function(x) { - ""; + ''; } }); -var r2 = r(""); +var r2 = r(''); diff --git a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints3.2.minified.js b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints3.2.minified.js index 350033394287..3f8be1983b77 100644 --- a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints3.2.minified.js +++ b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints3.2.minified.js @@ -14,4 +14,4 @@ new (function() { }).foo({ length: 3, charAt: function(x) {} -})(""); +})(''); diff --git a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints4.1.normal.js b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints4.1.normal.js index 4a700de039a9..8bce94186ae4 100644 --- a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints4.1.normal.js +++ b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints4.1.normal.js @@ -17,10 +17,10 @@ var C = /*#__PURE__*/ function() { var c = new C({ length: 2 }); -var r = c.foo(""); +var r = c.foo(''); var r2 = r({ length: 3, charAt: function(x) { - ""; + ''; } }); // error diff --git a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints4.2.minified.js b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints4.2.minified.js index f8d0713ffba3..c4bfd9e9fc2a 100644 --- a/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints4.2.minified.js +++ b/crates/swc/tests/tsc-references/wrappedAndRecursiveConstraints4.2.minified.js @@ -11,7 +11,7 @@ new (function() { }, C; }())({ length: 2 -}).foo("")({ +}).foo('')({ length: 3, charAt: function(x) {} }); diff --git a/crates/swc/tests/vercel/full/utf8-1/output/index.js b/crates/swc/tests/vercel/full/utf8-1/output/index.js index dad07a39f108..b4a2e397d170 100644 --- a/crates/swc/tests/vercel/full/utf8-1/output/index.js +++ b/crates/swc/tests/vercel/full/utf8-1/output/index.js @@ -1,18 +1,18 @@ import { _ as e } from "@swc/helpers/_/_async_to_generator"; import { _ as t } from "@swc/helpers/_/_ts_generator"; -import { displayContent as a } from "./fouc"; -import n from "./on-demand-entries-client"; -import { addMessageListener as r, connectHMR as c } from "./error-overlay/websocket"; -var o = JSON.parse(document.getElementById("__NEXT_DATA__").textContent); +import { displayContent as a } from './fouc'; +import n from './on-demand-entries-client'; +import { addMessageListener as r, connectHMR as c } from './error-overlay/websocket'; +var o = JSON.parse(document.getElementById('__NEXT_DATA__').textContent); window.__NEXT_DATA__ = o; -var s = o.assetPrefix, i = o.page, _ = null, u = __webpack_hash__, d = (s = s || "") + (s.endsWith("/") ? "" : "/") + "_next/static/webpack/"; +var s = o.assetPrefix, i = o.page, _ = null, u = __webpack_hash__, d = (s = s || '') + (s.endsWith('/') ? '' : '/') + '_next/static/webpack/'; function p() { return (p = e(function() { var e, a; return t(this, function(t) { switch(t.label){ case 0: - if (!(_ !== __webpack_hash__) || "idle" !== module.hot.status()) return [ + if (!(_ !== __webpack_hash__) || 'idle' !== module.hot.status()) return [ 2 ]; t.label = 1; @@ -24,7 +24,7 @@ function p() { 5 ]), [ 4, - fetch("undefined" != typeof __webpack_runtime_id__ ? "".concat(d).concat(u, ".").concat(__webpack_runtime_id__, ".hot-update.json") : "".concat(d).concat(u, ".hot-update.json")) + fetch('undefined' != typeof __webpack_runtime_id__ ? "".concat(d).concat(u, ".").concat(__webpack_runtime_id__, ".hot-update.json") : "".concat(d).concat(u, ".hot-update.json")) ]; case 2: return [ @@ -32,14 +32,14 @@ function p() { t.sent().json() ]; case 3: - return e = t.sent(), a = "/" === i ? "index" : i, (Array.isArray(e.c) ? e.c : Object.keys(e.c)).some(function(e) { - return -1 !== e.indexOf("pages".concat(a.startsWith("/") ? a : "/".concat(a))) || -1 !== e.indexOf("pages".concat(a.startsWith("/") ? a : "/".concat(a)).replace(/\//g, "\\")); + return e = t.sent(), a = '/' === i ? 'index' : i, (Array.isArray(e.c) ? e.c : Object.keys(e.c)).some(function(e) { + return -1 !== e.indexOf("pages".concat(a.startsWith('/') ? a : "/".concat(a))) || -1 !== e.indexOf("pages".concat(a.startsWith('/') ? a : "/".concat(a)).replace(/\//g, '\\')); }) ? document.location.reload(!0) : u = _, [ 3, 5 ]; case 4: - return console.error("Error occurred checking for update", t.sent()), document.location.reload(!0), [ + return console.error('Error occurred checking for update', t.sent()), document.location.reload(!0), [ 3, 5 ]; @@ -52,18 +52,18 @@ function p() { })).apply(this, arguments); } r(function(e) { - if ("\uD83D\uDC93" !== e.data) try { + if ('\uD83D\uDC93' !== e.data) try { var t = JSON.parse(e.data); - if ("sync" === t.action || "built" === t.action) { + if ('sync' === t.action || 'built' === t.action) { if (!t.hash) return; _ = t.hash, function() { p.apply(this, arguments); }(); - } else "reloadPage" === t.action && document.location.reload(!0); + } else 'reloadPage' === t.action && document.location.reload(!0); } catch (t) { - console.warn("Invalid HMR message: " + e.data + "\n" + t); + console.warn('Invalid HMR message: ' + e.data + '\n' + t); } }), c({ assetPrefix: s, - path: "/_next/webpack-hmr" + path: '/_next/webpack-hmr' }), a(), n(o.page); diff --git a/crates/swc/tests/vercel/loader-only/next-39460/output/snippetSession.js b/crates/swc/tests/vercel/loader-only/next-39460/output/snippetSession.js index d06c0dcdc275..04534538bfd6 100644 --- a/crates/swc/tests/vercel/loader-only/next-39460/output/snippetSession.js +++ b/crates/swc/tests/vercel/loader-only/next-39460/output/snippetSession.js @@ -7,18 +7,18 @@ import { _ as _instanceof } from "@swc/helpers/_/_instanceof"; import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array"; import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array"; import { _ as _type_of } from "@swc/helpers/_/_type_of"; -import { groupBy } from "../../../base/common/arrays.js"; -import { dispose } from "../../../base/common/lifecycle.js"; -import { getLeadingWhitespace } from "../../../base/common/strings.js"; -import "./snippetSession.css"; -import { EditOperation } from "../../common/core/editOperation.js"; -import { Range } from "../../common/core/range.js"; -import { Selection } from "../../common/core/selection.js"; -import { ModelDecorationOptions } from "../../common/model/textModel.js"; -import { ILabelService } from "../../../platform/label/common/label.js"; -import { IWorkspaceContextService } from "../../../platform/workspace/common/workspace.js"; -import { Choice, Placeholder, SnippetParser, Text } from "./snippetParser.js"; -import { ClipboardBasedVariableResolver, CommentBasedVariableResolver, CompositeSnippetVariableResolver, ModelBasedVariableResolver, RandomBasedVariableResolver, SelectionBasedVariableResolver, TimeBasedVariableResolver, WorkspaceBasedVariableResolver } from "./snippetVariables.js"; +import { groupBy } from '../../../base/common/arrays.js'; +import { dispose } from '../../../base/common/lifecycle.js'; +import { getLeadingWhitespace } from '../../../base/common/strings.js'; +import './snippetSession.css'; +import { EditOperation } from '../../common/core/editOperation.js'; +import { Range } from '../../common/core/range.js'; +import { Selection } from '../../common/core/selection.js'; +import { ModelDecorationOptions } from '../../common/model/textModel.js'; +import { ILabelService } from '../../../platform/label/common/label.js'; +import { IWorkspaceContextService } from '../../../platform/workspace/common/workspace.js'; +import { Choice, Placeholder, SnippetParser, Text } from './snippetParser.js'; +import { ClipboardBasedVariableResolver, CommentBasedVariableResolver, CompositeSnippetVariableResolver, ModelBasedVariableResolver, RandomBasedVariableResolver, SelectionBasedVariableResolver, TimeBasedVariableResolver, WorkspaceBasedVariableResolver } from './snippetVariables.js'; export var OneSnippet = /*#__PURE__*/ function() { "use strict"; function OneSnippet(_editor, _snippet, _offset, _snippetLineLeadingWhitespace) { @@ -124,7 +124,7 @@ export var OneSnippet = /*#__PURE__*/ function() { } } if (operations.length > 0) { - this._editor.executeEdits("snippet.placeholderTransform", operations); + this._editor.executeEdits('snippet.placeholderTransform', operations); } } var couldSkipThisPlaceholder = false; @@ -434,24 +434,24 @@ export var OneSnippet = /*#__PURE__*/ function() { }(); OneSnippet._decor = { active: ModelDecorationOptions.register({ - description: "snippet-placeholder-1", + description: 'snippet-placeholder-1', stickiness: 0 /* AlwaysGrowsWhenTypingAtEdges */ , - className: "snippet-placeholder" + className: 'snippet-placeholder' }), inactive: ModelDecorationOptions.register({ - description: "snippet-placeholder-2", + description: 'snippet-placeholder-2', stickiness: 1 /* NeverGrowsWhenTypingAtEdges */ , - className: "snippet-placeholder" + className: 'snippet-placeholder' }), activeFinal: ModelDecorationOptions.register({ - description: "snippet-placeholder-3", + description: 'snippet-placeholder-3', stickiness: 1 /* NeverGrowsWhenTypingAtEdges */ , - className: "finish-snippet-placeholder" + className: 'finish-snippet-placeholder' }), inactiveFinal: ModelDecorationOptions.register({ - description: "snippet-placeholder-4", + description: 'snippet-placeholder-4', stickiness: 1 /* NeverGrowsWhenTypingAtEdges */ , - className: "finish-snippet-placeholder" + className: 'finish-snippet-placeholder' }) }; var _defaultOptions = { @@ -482,7 +482,7 @@ export var SnippetSession = /*#__PURE__*/ function() { { key: "_logInfo", value: function _logInfo() { - return 'template="'.concat(this._template, '", merged_templates="').concat(this._templateMerges.join(" -> "), '"'); + return 'template="'.concat(this._template, '", merged_templates="').concat(this._templateMerges.join(' -> '), '"'); } }, { @@ -495,7 +495,7 @@ export var SnippetSession = /*#__PURE__*/ function() { // make insert edit and start with first selections var _SnippetSession_createEditsAndSnippets = SnippetSession.createEditsAndSnippets(this._editor, this._template, this._options.overwriteBefore, this._options.overwriteAfter, false, this._options.adjustWhitespace, this._options.clipboardText, this._options.overtypingCapturer), edits = _SnippetSession_createEditsAndSnippets.edits, snippets = _SnippetSession_createEditsAndSnippets.snippets; this._snippets = snippets; - this._editor.executeEdits("snippet", edits, function(undoEdits) { + this._editor.executeEdits('snippet', edits, function(undoEdits) { if (_this._snippets[0].hasPlaceholder) { return _this._move(true); } else { @@ -524,7 +524,7 @@ export var SnippetSession = /*#__PURE__*/ function() { template ]); var _SnippetSession_createEditsAndSnippets = SnippetSession.createEditsAndSnippets(this._editor, template, options.overwriteBefore, options.overwriteAfter, true, options.adjustWhitespace, options.clipboardText, options.overtypingCapturer), edits = _SnippetSession_createEditsAndSnippets.edits, snippets = _SnippetSession_createEditsAndSnippets.snippets; - this._editor.executeEdits("snippet", edits, function(undoEdits) { + this._editor.executeEdits('snippet', edits, function(undoEdits) { var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { for(var _iterator = _this._snippets[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ @@ -901,7 +901,7 @@ export var SnippetSession = /*#__PURE__*/ function() { var snippetLineLeadingWhitespace = SnippetSession.adjustWhitespace(model, start, snippet, adjustWhitespace || idx > 0 && firstLineFirstNonWhitespace !== model.getLineFirstNonWhitespaceColumn(selection.positionLineNumber), true); snippet.resolveVariables(new CompositeSnippetVariableResolver([ modelBasedVariableResolver, - new ClipboardBasedVariableResolver(readClipboardText, idx, indexedSelections.length, editor.getOption(70 /* multiCursorPaste */ ) === "spread"), + new ClipboardBasedVariableResolver(readClipboardText, idx, indexedSelections.length, editor.getOption(70 /* multiCursorPaste */ ) === 'spread'), new SelectionBasedVariableResolver(model, selection, idx, overtypingCapturer), new CommentBasedVariableResolver(model, selection), new TimeBasedVariableResolver, diff --git a/crates/swc_ecma_codegen/src/lib.rs b/crates/swc_ecma_codegen/src/lib.rs index d365aee75538..752bbd9b4331 100644 --- a/crates/swc_ecma_codegen/src/lib.rs +++ b/crates/swc_ecma_codegen/src/lib.rs @@ -633,7 +633,7 @@ where let target = self.cfg.target; - if target > EsVersion::Es5 && !self.cfg.minify { + if !self.cfg.minify { if let Some(raw) = &node.raw { if !self.cfg.ascii_only || raw.is_ascii() { self.wr.write_str_lit(DUMMY_SP, raw)?; diff --git a/crates/swc_ecma_codegen/src/tests.rs b/crates/swc_ecma_codegen/src/tests.rs index 1a66d887080c..08c2055e508d 100644 --- a/crates/swc_ecma_codegen/src/tests.rs +++ b/crates/swc_ecma_codegen/src/tests.rs @@ -712,8 +712,10 @@ fn issue_3617() { let from = r"// a string of all valid unicode whitespaces module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' + '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF' + '\u{a0}';"; - let expected = r#"// a string of all valid unicode whitespaces -module.exports = " \n\v\f\r \xa0\u1680\u2000\u2001\u2002" + "\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF" + "\xa0";"#; + let expected = "// a string of all valid unicode whitespaces\nmodule.exports = \ + '\\u0009\\u000A\\u000B\\u000C\\u000D\\u0020\\u00A0\\u1680\\u2000\\u2001\\\ + u2002' + '\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\\ + u205F\\u3000\\u2028\\u2029\\uFEFF' + '\\u{a0}';\n"; let out = parse_then_emit( from, diff --git a/crates/swc_ecma_codegen/tests/test262/00b851b06af02cc0.js b/crates/swc_ecma_codegen/tests/test262/00b851b06af02cc0.js index 9ddaff5463c0..9682f46abd20 100644 --- a/crates/swc_ecma_codegen/tests/test262/00b851b06af02cc0.js +++ b/crates/swc_ecma_codegen/tests/test262/00b851b06af02cc0.js @@ -1,5 +1,5 @@ -a.b("c").d("e", /*@ngInject*/ function(f) { +a.b('c').d('e', /*@ngInject*/ function(f) { return f; -}).g("h", /*@ngInject*/ function(i) { +}).g('h', /*@ngInject*/ function(i) { return i; }); diff --git a/crates/swc_ecma_codegen/tests/test262/070d82d1b3b3a975.js b/crates/swc_ecma_codegen/tests/test262/070d82d1b3b3a975.js index e7365b53e302..71e0aa642174 100644 --- a/crates/swc_ecma_codegen/tests/test262/070d82d1b3b3a975.js +++ b/crates/swc_ecma_codegen/tests/test262/070d82d1b3b3a975.js @@ -1,6 +1,6 @@ (function() { var a; - eval("a"); + eval('a'); function b() { a = a += 1; // eval makes dynamic } diff --git a/crates/swc_ecma_codegen/tests/test262/071f05b40ea0163f.js b/crates/swc_ecma_codegen/tests/test262/071f05b40ea0163f.js index 69bc707dde47..a8089b730f18 100644 --- a/crates/swc_ecma_codegen/tests/test262/071f05b40ea0163f.js +++ b/crates/swc_ecma_codegen/tests/test262/071f05b40ea0163f.js @@ -1,3 +1,3 @@ -new a("aa, [bb]", "return aa;"); -new a("aa, {bb}", "return aa;"); -new a("[[aa]], [{bb}]", "return aa;"); +new a("aa, [bb]", 'return aa;'); +new a("aa, {bb}", 'return aa;'); +new a("[[aa]], [{bb}]", 'return aa;'); diff --git a/crates/swc_ecma_codegen/tests/test262/0aeb95f62766e684.js b/crates/swc_ecma_codegen/tests/test262/0aeb95f62766e684.js index 103f3270b50d..e9eb37b0d80c 100644 --- a/crates/swc_ecma_codegen/tests/test262/0aeb95f62766e684.js +++ b/crates/swc_ecma_codegen/tests/test262/0aeb95f62766e684.js @@ -1 +1 @@ -"a"; +"\u0061"; diff --git a/crates/swc_ecma_codegen/tests/test262/0b1fc7208759253b.js b/crates/swc_ecma_codegen/tests/test262/0b1fc7208759253b.js index ae060d276c94..4a8da26c90da 100644 --- a/crates/swc_ecma_codegen/tests/test262/0b1fc7208759253b.js +++ b/crates/swc_ecma_codegen/tests/test262/0b1fc7208759253b.js @@ -1 +1 @@ -"\0\x01\x02\x03\x04\x05\x06\x07\b \n\v\f\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe" + a; +'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe' + a; diff --git a/crates/swc_ecma_codegen/tests/test262/0b281915a3227177.js b/crates/swc_ecma_codegen/tests/test262/0b281915a3227177.js index c2c8ae076e7e..12516db3da6a 100644 --- a/crates/swc_ecma_codegen/tests/test262/0b281915a3227177.js +++ b/crates/swc_ecma_codegen/tests/test262/0b281915a3227177.js @@ -1 +1 @@ -"Hello\nWorld"; +"Hello\012World"; diff --git a/crates/swc_ecma_codegen/tests/test262/110fa1efdd0868b8.js b/crates/swc_ecma_codegen/tests/test262/110fa1efdd0868b8.js index ccbf29eb2e58..2303202fd1ce 100644 --- a/crates/swc_ecma_codegen/tests/test262/110fa1efdd0868b8.js +++ b/crates/swc_ecma_codegen/tests/test262/110fa1efdd0868b8.js @@ -1 +1,2 @@ -"Helloworld"; +"Hello\ +world"; diff --git a/crates/swc_ecma_codegen/tests/test262/12e59b6d403833ae.js b/crates/swc_ecma_codegen/tests/test262/12e59b6d403833ae.js index 83a17cabbc65..e407313186de 100644 --- a/crates/swc_ecma_codegen/tests/test262/12e59b6d403833ae.js +++ b/crates/swc_ecma_codegen/tests/test262/12e59b6d403833ae.js @@ -1,2 +1,2 @@ -"use strict"; +'use strict'; a(); diff --git a/crates/swc_ecma_codegen/tests/test262/1450a897a4ba83a7.js b/crates/swc_ecma_codegen/tests/test262/1450a897a4ba83a7.js index 39177ce18ab4..e023c151460f 100644 --- a/crates/swc_ecma_codegen/tests/test262/1450a897a4ba83a7.js +++ b/crates/swc_ecma_codegen/tests/test262/1450a897a4ba83a7.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var a = { - "0": "b" + '0': 'b' }; diff --git a/crates/swc_ecma_codegen/tests/test262/15dfd62aa10c8b18.js b/crates/swc_ecma_codegen/tests/test262/15dfd62aa10c8b18.js index 8bbe415a5779..c87e345300e3 100644 --- a/crates/swc_ecma_codegen/tests/test262/15dfd62aa10c8b18.js +++ b/crates/swc_ecma_codegen/tests/test262/15dfd62aa10c8b18.js @@ -1,4 +1,4 @@ function a() { - "use strict"; + 'use strict'; 0; } diff --git a/crates/swc_ecma_codegen/tests/test262/17d63bb0b9482189.js b/crates/swc_ecma_codegen/tests/test262/17d63bb0b9482189.js index 9b59fe586b11..5f814f1a63e7 100644 --- a/crates/swc_ecma_codegen/tests/test262/17d63bb0b9482189.js +++ b/crates/swc_ecma_codegen/tests/test262/17d63bb0b9482189.js @@ -1 +1 @@ -var a = "very cute"; +var a = 'very cute'; diff --git a/crates/swc_ecma_codegen/tests/test262/17d881105a9a6c85.js b/crates/swc_ecma_codegen/tests/test262/17d881105a9a6c85.js index 0692cf25823c..01aeed00e034 100644 --- a/crates/swc_ecma_codegen/tests/test262/17d881105a9a6c85.js +++ b/crates/swc_ecma_codegen/tests/test262/17d881105a9a6c85.js @@ -1,4 +1,4 @@ for(var a in b)// do not optimize it (function() { - c("d"); + c('d'); }()); diff --git a/crates/swc_ecma_codegen/tests/test262/1ca991b39b6e7754.js b/crates/swc_ecma_codegen/tests/test262/1ca991b39b6e7754.js index 056b2ff062b2..833b6e07da65 100644 --- a/crates/swc_ecma_codegen/tests/test262/1ca991b39b6e7754.js +++ b/crates/swc_ecma_codegen/tests/test262/1ca991b39b6e7754.js @@ -1 +1 @@ -void "test string"; +void 'test string'; diff --git a/crates/swc_ecma_codegen/tests/test262/1e3f57c4ec83f5bc.js b/crates/swc_ecma_codegen/tests/test262/1e3f57c4ec83f5bc.js index 8f382efc05e3..56324056cc06 100644 --- a/crates/swc_ecma_codegen/tests/test262/1e3f57c4ec83f5bc.js +++ b/crates/swc_ecma_codegen/tests/test262/1e3f57c4ec83f5bc.js @@ -1 +1 @@ -a(b(c + "d"), b("d" + c)); +a(b(c + 'd'), b('d' + c)); diff --git a/crates/swc_ecma_codegen/tests/test262/1e61843633dcb483.js b/crates/swc_ecma_codegen/tests/test262/1e61843633dcb483.js index c374f2e4070a..cc5f4c71f8c2 100644 --- a/crates/swc_ecma_codegen/tests/test262/1e61843633dcb483.js +++ b/crates/swc_ecma_codegen/tests/test262/1e61843633dcb483.js @@ -1,4 +1,4 @@ (function() { - "use\nstrict"; + 'use\nstrict'; with (a); }()); diff --git a/crates/swc_ecma_codegen/tests/test262/20644d335e3cd008.js b/crates/swc_ecma_codegen/tests/test262/20644d335e3cd008.js index 8529725d18c9..2a67b2bdd14c 100644 --- a/crates/swc_ecma_codegen/tests/test262/20644d335e3cd008.js +++ b/crates/swc_ecma_codegen/tests/test262/20644d335e3cd008.js @@ -1 +1 @@ -"Hello\xcaWorld"; +"Hello\312World"; diff --git a/crates/swc_ecma_codegen/tests/test262/20aca21e32bf7772.js b/crates/swc_ecma_codegen/tests/test262/20aca21e32bf7772.js index e31d16fd1020..b9c8d7090663 100644 --- a/crates/swc_ecma_codegen/tests/test262/20aca21e32bf7772.js +++ b/crates/swc_ecma_codegen/tests/test262/20aca21e32bf7772.js @@ -1 +1 @@ -("\uDBFF\uDFFF"); +('\u{10FFFF}'); diff --git a/crates/swc_ecma_codegen/tests/test262/218e751b8b453b9b.js b/crates/swc_ecma_codegen/tests/test262/218e751b8b453b9b.js index 0e207c4f3112..9e43cc24e8fd 100644 --- a/crates/swc_ecma_codegen/tests/test262/218e751b8b453b9b.js +++ b/crates/swc_ecma_codegen/tests/test262/218e751b8b453b9b.js @@ -1,7 +1,7 @@ if (a) { // optimize it (function() { - b("c"); + b('c'); }()); try { b("d"); diff --git a/crates/swc_ecma_codegen/tests/test262/230da70c908c1859.js b/crates/swc_ecma_codegen/tests/test262/230da70c908c1859.js index 4f7eafbe066c..cd02fd5eb0f7 100644 --- a/crates/swc_ecma_codegen/tests/test262/230da70c908c1859.js +++ b/crates/swc_ecma_codegen/tests/test262/230da70c908c1859.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var a = { delete: 1 }; diff --git a/crates/swc_ecma_codegen/tests/test262/242ede66951e11b1.js b/crates/swc_ecma_codegen/tests/test262/242ede66951e11b1.js index 68fc619c52da..6fb3b6918eef 100644 --- a/crates/swc_ecma_codegen/tests/test262/242ede66951e11b1.js +++ b/crates/swc_ecma_codegen/tests/test262/242ede66951e11b1.js @@ -1,5 +1,5 @@ // optimize this (function() { - a("b"); + a('b'); }()); try {} catch (c) {} diff --git a/crates/swc_ecma_codegen/tests/test262/25542e65ad9d2bf1.js b/crates/swc_ecma_codegen/tests/test262/25542e65ad9d2bf1.js index 9f67dbce2348..bcece14a7f35 100644 --- a/crates/swc_ecma_codegen/tests/test262/25542e65ad9d2bf1.js +++ b/crates/swc_ecma_codegen/tests/test262/25542e65ad9d2bf1.js @@ -1,4 +1,4 @@ (function() { var a; - b(typeof a === "c"); + b(typeof a === 'c'); }()); diff --git a/crates/swc_ecma_codegen/tests/test262/25fd48ccc3bef96a.js b/crates/swc_ecma_codegen/tests/test262/25fd48ccc3bef96a.js index 9f51e7aaccaf..e6ab0e46a41a 100644 --- a/crates/swc_ecma_codegen/tests/test262/25fd48ccc3bef96a.js +++ b/crates/swc_ecma_codegen/tests/test262/25fd48ccc3bef96a.js @@ -1,3 +1,3 @@ (function() { - a(typeof b !== "c"); + a(typeof b !== 'c'); }()); diff --git a/crates/swc_ecma_codegen/tests/test262/264266c68369c672.js b/crates/swc_ecma_codegen/tests/test262/264266c68369c672.js index 572acee3f1fe..eda368f94c1b 100644 --- a/crates/swc_ecma_codegen/tests/test262/264266c68369c672.js +++ b/crates/swc_ecma_codegen/tests/test262/264266c68369c672.js @@ -1,6 +1,6 @@ function a() { var b; - if (b = "b") { + if (b = 'b') { return b; } else { return b; diff --git a/crates/swc_ecma_codegen/tests/test262/27ca96102da82628.js b/crates/swc_ecma_codegen/tests/test262/27ca96102da82628.js index 3a0560a58063..daf5829715ff 100644 --- a/crates/swc_ecma_codegen/tests/test262/27ca96102da82628.js +++ b/crates/swc_ecma_codegen/tests/test262/27ca96102da82628.js @@ -1 +1 @@ -"Hello92World"; +"Hello\712World"; diff --git a/crates/swc_ecma_codegen/tests/test262/2a7d131074016ba6.js b/crates/swc_ecma_codegen/tests/test262/2a7d131074016ba6.js index 64edfbefd58d..3942c0bbc58a 100644 --- a/crates/swc_ecma_codegen/tests/test262/2a7d131074016ba6.js +++ b/crates/swc_ecma_codegen/tests/test262/2a7d131074016ba6.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var a = function(b) { b(); a(); diff --git a/crates/swc_ecma_codegen/tests/test262/2b9d4a632590814a.js b/crates/swc_ecma_codegen/tests/test262/2b9d4a632590814a.js index 8bbe415a5779..c87e345300e3 100644 --- a/crates/swc_ecma_codegen/tests/test262/2b9d4a632590814a.js +++ b/crates/swc_ecma_codegen/tests/test262/2b9d4a632590814a.js @@ -1,4 +1,4 @@ function a() { - "use strict"; + 'use strict'; 0; } diff --git a/crates/swc_ecma_codegen/tests/test262/2c4b264884006a8e.js b/crates/swc_ecma_codegen/tests/test262/2c4b264884006a8e.js index b0fd74afb86d..4d3e0ef25050 100644 --- a/crates/swc_ecma_codegen/tests/test262/2c4b264884006a8e.js +++ b/crates/swc_ecma_codegen/tests/test262/2c4b264884006a8e.js @@ -1,4 +1,4 @@ (function() { - throw "a"; + throw 'a'; with (b); // This should be removed. }()); diff --git a/crates/swc_ecma_codegen/tests/test262/2d10fed2af94fbd1.js b/crates/swc_ecma_codegen/tests/test262/2d10fed2af94fbd1.js index 0006214c770d..366db03cd666 100644 --- a/crates/swc_ecma_codegen/tests/test262/2d10fed2af94fbd1.js +++ b/crates/swc_ecma_codegen/tests/test262/2d10fed2af94fbd1.js @@ -1,3 +1,3 @@ (a)=>{ - "use strict"; + 'use strict'; }; diff --git a/crates/swc_ecma_codegen/tests/test262/2e371094f1b1ac51.js b/crates/swc_ecma_codegen/tests/test262/2e371094f1b1ac51.js index 7a952d6cbe6f..00e496d28dbc 100644 --- a/crates/swc_ecma_codegen/tests/test262/2e371094f1b1ac51.js +++ b/crates/swc_ecma_codegen/tests/test262/2e371094f1b1ac51.js @@ -1 +1 @@ -("I1"); +('\1111'); diff --git a/crates/swc_ecma_codegen/tests/test262/2e5fbf7b1685fa1b.js b/crates/swc_ecma_codegen/tests/test262/2e5fbf7b1685fa1b.js index b616528e83a2..bcf2466b3ab6 100644 --- a/crates/swc_ecma_codegen/tests/test262/2e5fbf7b1685fa1b.js +++ b/crates/swc_ecma_codegen/tests/test262/2e5fbf7b1685fa1b.js @@ -2,6 +2,6 @@ var a = 1; // should not hoist this arguments[2] = 3; (function() { - eval(""); + eval(''); }()); }()); diff --git a/crates/swc_ecma_codegen/tests/test262/3098b57020860587.js b/crates/swc_ecma_codegen/tests/test262/3098b57020860587.js index 9dd796742842..cb3a3aa123d0 100644 --- a/crates/swc_ecma_codegen/tests/test262/3098b57020860587.js +++ b/crates/swc_ecma_codegen/tests/test262/3098b57020860587.js @@ -1,4 +1,4 @@ (function() { var a = 1; // should not hoist to parameter - eval(""); + eval(''); }()); diff --git a/crates/swc_ecma_codegen/tests/test262/30aee1020fc69090.js b/crates/swc_ecma_codegen/tests/test262/30aee1020fc69090.js index 44f29b863fa2..2e1b0261eba3 100644 --- a/crates/swc_ecma_codegen/tests/test262/30aee1020fc69090.js +++ b/crates/swc_ecma_codegen/tests/test262/30aee1020fc69090.js @@ -1,5 +1,5 @@ (class { set a(b) { - "use strict"; + 'use strict'; } }); diff --git a/crates/swc_ecma_codegen/tests/test262/3156a92ca5319b8b.js b/crates/swc_ecma_codegen/tests/test262/3156a92ca5319b8b.js index 0117dbfc5a85..e538940ef7f4 100644 --- a/crates/swc_ecma_codegen/tests/test262/3156a92ca5319b8b.js +++ b/crates/swc_ecma_codegen/tests/test262/3156a92ca5319b8b.js @@ -1,2 +1,2 @@ -throw "a"; +throw 'a'; b(); diff --git a/crates/swc_ecma_codegen/tests/test262/317532451c2ce8ff.js b/crates/swc_ecma_codegen/tests/test262/317532451c2ce8ff.js index c4beccfa5b16..04d124798dc4 100644 --- a/crates/swc_ecma_codegen/tests/test262/317532451c2ce8ff.js +++ b/crates/swc_ecma_codegen/tests/test262/317532451c2ce8ff.js @@ -1,2 +1,2 @@ -"use strict"; +'use strict'; var a = function() {}(b()); diff --git a/crates/swc_ecma_codegen/tests/test262/3315c524a740fe55.js b/crates/swc_ecma_codegen/tests/test262/3315c524a740fe55.js index d006ff8987fb..56fa15b06add 100644 --- a/crates/swc_ecma_codegen/tests/test262/3315c524a740fe55.js +++ b/crates/swc_ecma_codegen/tests/test262/3315c524a740fe55.js @@ -1 +1 @@ -("\\'"); +('\\\''); diff --git a/crates/swc_ecma_codegen/tests/test262/3793ec99f844de1c.js b/crates/swc_ecma_codegen/tests/test262/3793ec99f844de1c.js index 1ae39213d590..e9668d38d7d4 100644 --- a/crates/swc_ecma_codegen/tests/test262/3793ec99f844de1c.js +++ b/crates/swc_ecma_codegen/tests/test262/3793ec99f844de1c.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var a = { - "b": 1 + 'b': 1 }; diff --git a/crates/swc_ecma_codegen/tests/test262/37c0f5275362d1c9.js b/crates/swc_ecma_codegen/tests/test262/37c0f5275362d1c9.js index 00a334b16aa8..1e13f660375a 100644 --- a/crates/swc_ecma_codegen/tests/test262/37c0f5275362d1c9.js +++ b/crates/swc_ecma_codegen/tests/test262/37c0f5275362d1c9.js @@ -1 +1 @@ -"4"; +"\u{00000000034}"; diff --git a/crates/swc_ecma_codegen/tests/test262/37d26e3bec6d9a0f.js b/crates/swc_ecma_codegen/tests/test262/37d26e3bec6d9a0f.js index c1f6ba83857c..b3281627bdf4 100644 --- a/crates/swc_ecma_codegen/tests/test262/37d26e3bec6d9a0f.js +++ b/crates/swc_ecma_codegen/tests/test262/37d26e3bec6d9a0f.js @@ -2,6 +2,6 @@ switch(a){ default: // do not optimize it (function() { - b("c"); + b('c'); }()); } diff --git a/crates/swc_ecma_codegen/tests/test262/3990bb94b19b1071.js b/crates/swc_ecma_codegen/tests/test262/3990bb94b19b1071.js index 9a2aca68156b..0ae8be302e5d 100644 --- a/crates/swc_ecma_codegen/tests/test262/3990bb94b19b1071.js +++ b/crates/swc_ecma_codegen/tests/test262/3990bb94b19b1071.js @@ -1 +1 @@ -("\x01"); +('\1'); diff --git a/crates/swc_ecma_codegen/tests/test262/3a1f039e533d1543.js b/crates/swc_ecma_codegen/tests/test262/3a1f039e533d1543.js index 1e72fb4a8eb0..88e7f920706a 100644 --- a/crates/swc_ecma_codegen/tests/test262/3a1f039e533d1543.js +++ b/crates/swc_ecma_codegen/tests/test262/3a1f039e533d1543.js @@ -1,2 +1,2 @@ -"use strict"; +'use strict'; a.static(); diff --git a/crates/swc_ecma_codegen/tests/test262/3ae4f46daa688c58.js b/crates/swc_ecma_codegen/tests/test262/3ae4f46daa688c58.js index 5e26598bc13e..53c773b3ea98 100644 --- a/crates/swc_ecma_codegen/tests/test262/3ae4f46daa688c58.js +++ b/crates/swc_ecma_codegen/tests/test262/3ae4f46daa688c58.js @@ -1,2 +1,2 @@ -"use strict"; -("\0"); +'use strict'; +('\0'); diff --git a/crates/swc_ecma_codegen/tests/test262/3b36d546985cd9cb.js b/crates/swc_ecma_codegen/tests/test262/3b36d546985cd9cb.js index ccbf29eb2e58..2303202fd1ce 100644 --- a/crates/swc_ecma_codegen/tests/test262/3b36d546985cd9cb.js +++ b/crates/swc_ecma_codegen/tests/test262/3b36d546985cd9cb.js @@ -1 +1,2 @@ -"Helloworld"; +"Hello\ +world"; diff --git a/crates/swc_ecma_codegen/tests/test262/3d2ab39608730a47.js b/crates/swc_ecma_codegen/tests/test262/3d2ab39608730a47.js index f172469b2eb3..46cd156e05bd 100644 --- a/crates/swc_ecma_codegen/tests/test262/3d2ab39608730a47.js +++ b/crates/swc_ecma_codegen/tests/test262/3d2ab39608730a47.js @@ -1,2 +1,2 @@ -"use strict"; -("\0x"); +'use strict'; +('\0x'); diff --git a/crates/swc_ecma_codegen/tests/test262/3e48826018d23c85.js b/crates/swc_ecma_codegen/tests/test262/3e48826018d23c85.js index 0712d31a0198..60ac71cbe506 100644 --- a/crates/swc_ecma_codegen/tests/test262/3e48826018d23c85.js +++ b/crates/swc_ecma_codegen/tests/test262/3e48826018d23c85.js @@ -1 +1 @@ -("\x05a"); +('\5a'); diff --git a/crates/swc_ecma_codegen/tests/test262/3eb2c2bf585c0916.js b/crates/swc_ecma_codegen/tests/test262/3eb2c2bf585c0916.js index caebe44be171..2314267c83f7 100644 --- a/crates/swc_ecma_codegen/tests/test262/3eb2c2bf585c0916.js +++ b/crates/swc_ecma_codegen/tests/test262/3eb2c2bf585c0916.js @@ -1 +1 @@ -void ("a" + "a"); +void ('a' + 'a'); diff --git a/crates/swc_ecma_codegen/tests/test262/3f46ee1db509d55d.js b/crates/swc_ecma_codegen/tests/test262/3f46ee1db509d55d.js index 8e91f6163dda..35fb7925eb5e 100644 --- a/crates/swc_ecma_codegen/tests/test262/3f46ee1db509d55d.js +++ b/crates/swc_ecma_codegen/tests/test262/3f46ee1db509d55d.js @@ -1 +1 @@ -(1, a["a"])(); +(1, a['a'])(); diff --git a/crates/swc_ecma_codegen/tests/test262/3fb07536eb5aea8d.js b/crates/swc_ecma_codegen/tests/test262/3fb07536eb5aea8d.js index 8777512faa0c..6e417abd13f1 100644 --- a/crates/swc_ecma_codegen/tests/test262/3fb07536eb5aea8d.js +++ b/crates/swc_ecma_codegen/tests/test262/3fb07536eb5aea8d.js @@ -1 +1 @@ -"Hello!2World"; +"Hello\412World"; diff --git a/crates/swc_ecma_codegen/tests/test262/40adcdf7cfe3fa0d.js b/crates/swc_ecma_codegen/tests/test262/40adcdf7cfe3fa0d.js index 4f132a10acf5..18db71068614 100644 --- a/crates/swc_ecma_codegen/tests/test262/40adcdf7cfe3fa0d.js +++ b/crates/swc_ecma_codegen/tests/test262/40adcdf7cfe3fa0d.js @@ -1,3 +1,3 @@ function a() { - "use strict"; + 'use strict'; /* Comment */ } diff --git a/crates/swc_ecma_codegen/tests/test262/4672c2ef688237c9.js b/crates/swc_ecma_codegen/tests/test262/4672c2ef688237c9.js index 6e7bb0b7e5a1..99f1c5107580 100644 --- a/crates/swc_ecma_codegen/tests/test262/4672c2ef688237c9.js +++ b/crates/swc_ecma_codegen/tests/test262/4672c2ef688237c9.js @@ -1 +1 @@ -"\n\r \v\b\f\\'\"\0"; +"\n\r\t\v\b\f\\\'\"\0"; diff --git a/crates/swc_ecma_codegen/tests/test262/47ea193a5fc3f2c7.js b/crates/swc_ecma_codegen/tests/test262/47ea193a5fc3f2c7.js index 20a1600e5b4f..af1aac4fc992 100644 --- a/crates/swc_ecma_codegen/tests/test262/47ea193a5fc3f2c7.js +++ b/crates/swc_ecma_codegen/tests/test262/47ea193a5fc3f2c7.js @@ -1,3 +1,3 @@ (function() { - a["b"]; + a['b']; }()); diff --git a/crates/swc_ecma_codegen/tests/test262/4a0d9236bc523b77.js b/crates/swc_ecma_codegen/tests/test262/4a0d9236bc523b77.js index 46e1d4e0e521..bc8b9e6baeb8 100644 --- a/crates/swc_ecma_codegen/tests/test262/4a0d9236bc523b77.js +++ b/crates/swc_ecma_codegen/tests/test262/4a0d9236bc523b77.js @@ -1 +1 @@ -("\xf8"); +('\u{0000000000F8}'); diff --git a/crates/swc_ecma_codegen/tests/test262/4a79205bd8cd49d0.js b/crates/swc_ecma_codegen/tests/test262/4a79205bd8cd49d0.js index 3153041df22d..335f8e2efc26 100644 --- a/crates/swc_ecma_codegen/tests/test262/4a79205bd8cd49d0.js +++ b/crates/swc_ecma_codegen/tests/test262/4a79205bd8cd49d0.js @@ -1,3 +1,3 @@ (function a() { - b(typeof a() == "c"); + b(typeof a() == 'c'); }()); diff --git a/crates/swc_ecma_codegen/tests/test262/4b346e8c85a29408.js b/crates/swc_ecma_codegen/tests/test262/4b346e8c85a29408.js index 05c421674ead..f7e9addbc677 100644 --- a/crates/swc_ecma_codegen/tests/test262/4b346e8c85a29408.js +++ b/crates/swc_ecma_codegen/tests/test262/4b346e8c85a29408.js @@ -1,5 +1,5 @@ (function() { var a = { - "b": 1 + 'b': 1 }; }()); diff --git a/crates/swc_ecma_codegen/tests/test262/4e07f8992cca7db0.js b/crates/swc_ecma_codegen/tests/test262/4e07f8992cca7db0.js index 3979e1d96402..91b09ebb7e91 100644 --- a/crates/swc_ecma_codegen/tests/test262/4e07f8992cca7db0.js +++ b/crates/swc_ecma_codegen/tests/test262/4e07f8992cca7db0.js @@ -1,2 +1,2 @@ -"use strict"; +'use strict'; 0; diff --git a/crates/swc_ecma_codegen/tests/test262/4fa08a62c2d8c495.js b/crates/swc_ecma_codegen/tests/test262/4fa08a62c2d8c495.js index 6ae279ce57dc..051be6f72dd3 100644 --- a/crates/swc_ecma_codegen/tests/test262/4fa08a62c2d8c495.js +++ b/crates/swc_ecma_codegen/tests/test262/4fa08a62c2d8c495.js @@ -1 +1 @@ -(a = b("100")) == a; +(a = b('100')) == a; diff --git a/crates/swc_ecma_codegen/tests/test262/513275ce0e3c7ef3.js b/crates/swc_ecma_codegen/tests/test262/513275ce0e3c7ef3.js index abbb680e4961..3e90d1b7bbd1 100644 --- a/crates/swc_ecma_codegen/tests/test262/513275ce0e3c7ef3.js +++ b/crates/swc_ecma_codegen/tests/test262/513275ce0e3c7ef3.js @@ -1,5 +1,5 @@ -"use strict"; +'use strict'; var a = { - "arguments": 1, - "eval": 2 + 'arguments': 1, + 'eval': 2 }; diff --git a/crates/swc_ecma_codegen/tests/test262/515825915b8d1cd8.js b/crates/swc_ecma_codegen/tests/test262/515825915b8d1cd8.js index 7dcf380015ff..a358234170a7 100644 --- a/crates/swc_ecma_codegen/tests/test262/515825915b8d1cd8.js +++ b/crates/swc_ecma_codegen/tests/test262/515825915b8d1cd8.js @@ -2,6 +2,6 @@ while(a){ try {} catch (b) {} // do not optimize it (function() { - c("d"); + c('d'); }()); } diff --git a/crates/swc_ecma_codegen/tests/test262/54fb77cb2384a86b.js b/crates/swc_ecma_codegen/tests/test262/54fb77cb2384a86b.js index 6244b178739c..317471b95bf1 100644 --- a/crates/swc_ecma_codegen/tests/test262/54fb77cb2384a86b.js +++ b/crates/swc_ecma_codegen/tests/test262/54fb77cb2384a86b.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; { var a = 1; b(); diff --git a/crates/swc_ecma_codegen/tests/test262/5526c98fdf9150c1.js b/crates/swc_ecma_codegen/tests/test262/5526c98fdf9150c1.js index e80024cf8539..79a1c6246053 100644 --- a/crates/swc_ecma_codegen/tests/test262/5526c98fdf9150c1.js +++ b/crates/swc_ecma_codegen/tests/test262/5526c98fdf9150c1.js @@ -1,6 +1,6 @@ (function() { try { - throw "a"; + throw 'a'; } catch (b) {} finally{ return 1; } diff --git a/crates/swc_ecma_codegen/tests/test262/56dcd0733a23aa26.js b/crates/swc_ecma_codegen/tests/test262/56dcd0733a23aa26.js index ade934bc43ef..aeeea9761705 100644 --- a/crates/swc_ecma_codegen/tests/test262/56dcd0733a23aa26.js +++ b/crates/swc_ecma_codegen/tests/test262/56dcd0733a23aa26.js @@ -2,12 +2,12 @@ if (a) { try {} catch (b) {} // do not optimize it (function() { - c("d"); + c('d'); }()); } else { try {} catch (b) {} // do not optimize it (function() { - c("d"); + c('d'); }()); } diff --git a/crates/swc_ecma_codegen/tests/test262/575306c08cc44b10.js b/crates/swc_ecma_codegen/tests/test262/575306c08cc44b10.js index aefa84653dd0..9580e6e8e76a 100644 --- a/crates/swc_ecma_codegen/tests/test262/575306c08cc44b10.js +++ b/crates/swc_ecma_codegen/tests/test262/575306c08cc44b10.js @@ -1,3 +1,3 @@ (function() { - a["NaN"] = 1; + a['NaN'] = 1; }()); diff --git a/crates/swc_ecma_codegen/tests/test262/57971b49e239c0ff.js b/crates/swc_ecma_codegen/tests/test262/57971b49e239c0ff.js index b33cdbc74161..847569dcedf3 100644 --- a/crates/swc_ecma_codegen/tests/test262/57971b49e239c0ff.js +++ b/crates/swc_ecma_codegen/tests/test262/57971b49e239c0ff.js @@ -1,3 +1,3 @@ function a(a) { - "use strict"; + 'use strict'; } diff --git a/crates/swc_ecma_codegen/tests/test262/599dff255c5ec792.js b/crates/swc_ecma_codegen/tests/test262/599dff255c5ec792.js index 52a9ae812ffa..b0a21766bf37 100644 --- a/crates/swc_ecma_codegen/tests/test262/599dff255c5ec792.js +++ b/crates/swc_ecma_codegen/tests/test262/599dff255c5ec792.js @@ -1 +1 @@ -(eval)=>"use strict"; +(eval)=>'use strict'; diff --git a/crates/swc_ecma_codegen/tests/test262/5b146261dda66d63.js b/crates/swc_ecma_codegen/tests/test262/5b146261dda66d63.js index 2726951f282f..997b1ff090f2 100644 --- a/crates/swc_ecma_codegen/tests/test262/5b146261dda66d63.js +++ b/crates/swc_ecma_codegen/tests/test262/5b146261dda66d63.js @@ -1 +1 @@ -("‪"); +('‪'); diff --git a/crates/swc_ecma_codegen/tests/test262/5b683275df4548d1.js b/crates/swc_ecma_codegen/tests/test262/5b683275df4548d1.js index 7e8129afe14e..f9ed597dd558 100644 --- a/crates/swc_ecma_codegen/tests/test262/5b683275df4548d1.js +++ b/crates/swc_ecma_codegen/tests/test262/5b683275df4548d1.js @@ -1,5 +1,5 @@ (function() { var a = 1; a; // 'i' should remain (dynamic) - eval(""); + eval(''); }()); diff --git a/crates/swc_ecma_codegen/tests/test262/5beffd72ddb47f13.js b/crates/swc_ecma_codegen/tests/test262/5beffd72ddb47f13.js index a1a575c76e02..f3b855315572 100644 --- a/crates/swc_ecma_codegen/tests/test262/5beffd72ddb47f13.js +++ b/crates/swc_ecma_codegen/tests/test262/5beffd72ddb47f13.js @@ -1 +1 @@ -("a"); +('\a'); diff --git a/crates/swc_ecma_codegen/tests/test262/61d8a7e497b6db72.js b/crates/swc_ecma_codegen/tests/test262/61d8a7e497b6db72.js index 5023f36676cf..fd8989bfae3c 100644 --- a/crates/swc_ecma_codegen/tests/test262/61d8a7e497b6db72.js +++ b/crates/swc_ecma_codegen/tests/test262/61d8a7e497b6db72.js @@ -1,7 +1,7 @@ (function() { function a() { (function() { - b("c"); + b('c'); }()); } a(); diff --git a/crates/swc_ecma_codegen/tests/test262/627fede559e0bcac.js b/crates/swc_ecma_codegen/tests/test262/627fede559e0bcac.js index 6c9b918291ac..e98f5c19a9d8 100644 --- a/crates/swc_ecma_codegen/tests/test262/627fede559e0bcac.js +++ b/crates/swc_ecma_codegen/tests/test262/627fede559e0bcac.js @@ -1 +1 @@ -(a = b("100")) != a; +(a = b('100')) != a; diff --git a/crates/swc_ecma_codegen/tests/test262/647e21f8f157c338.js b/crates/swc_ecma_codegen/tests/test262/647e21f8f157c338.js index 4368485921a7..d34bdfe5fe2a 100644 --- a/crates/swc_ecma_codegen/tests/test262/647e21f8f157c338.js +++ b/crates/swc_ecma_codegen/tests/test262/647e21f8f157c338.js @@ -1 +1 @@ -("\u2029"); +('
'); diff --git a/crates/swc_ecma_codegen/tests/test262/664b0da1dd015106.js b/crates/swc_ecma_codegen/tests/test262/664b0da1dd015106.js index f59d8d17885d..a57de088c762 100644 --- a/crates/swc_ecma_codegen/tests/test262/664b0da1dd015106.js +++ b/crates/swc_ecma_codegen/tests/test262/664b0da1dd015106.js @@ -1,5 +1,5 @@ a["b"] = "c"; a["if"] = "if"; a["*"] = "d"; -a["ຳ"] = "e"; +a["\u0EB3"] = "e"; a[""] = "f"; diff --git a/crates/swc_ecma_codegen/tests/test262/66aabbb5b00fb1ae.js b/crates/swc_ecma_codegen/tests/test262/66aabbb5b00fb1ae.js index e8aceba71f32..5d46bf37a4ca 100644 --- a/crates/swc_ecma_codegen/tests/test262/66aabbb5b00fb1ae.js +++ b/crates/swc_ecma_codegen/tests/test262/66aabbb5b00fb1ae.js @@ -1,5 +1,5 @@ (function() { var a = 1; a; - eval(""); + eval(''); }()); diff --git a/crates/swc_ecma_codegen/tests/test262/68125aef6f5cc46f.js b/crates/swc_ecma_codegen/tests/test262/68125aef6f5cc46f.js index 3979e1d96402..91b09ebb7e91 100644 --- a/crates/swc_ecma_codegen/tests/test262/68125aef6f5cc46f.js +++ b/crates/swc_ecma_codegen/tests/test262/68125aef6f5cc46f.js @@ -1,2 +1,2 @@ -"use strict"; +'use strict'; 0; diff --git a/crates/swc_ecma_codegen/tests/test262/697b3d30c1d06918.js b/crates/swc_ecma_codegen/tests/test262/697b3d30c1d06918.js index 62308316c8ba..23b679104b01 100644 --- a/crates/swc_ecma_codegen/tests/test262/697b3d30c1d06918.js +++ b/crates/swc_ecma_codegen/tests/test262/697b3d30c1d06918.js @@ -1,5 +1,5 @@ function a() { - "use strict"; + 'use strict'; ({ b: 1, b: 2 diff --git a/crates/swc_ecma_codegen/tests/test262/6edc155d463535cb.js b/crates/swc_ecma_codegen/tests/test262/6edc155d463535cb.js index f55e5c1c6e67..5a7a9ec3e283 100644 --- a/crates/swc_ecma_codegen/tests/test262/6edc155d463535cb.js +++ b/crates/swc_ecma_codegen/tests/test262/6edc155d463535cb.js @@ -1,5 +1,5 @@ (function() { - "use strict"; + 'use strict'; a = 1; function b() {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/717b2f65b69e809e.js b/crates/swc_ecma_codegen/tests/test262/717b2f65b69e809e.js index 592482df3c0e..742f593c51d2 100644 --- a/crates/swc_ecma_codegen/tests/test262/717b2f65b69e809e.js +++ b/crates/swc_ecma_codegen/tests/test262/717b2f65b69e809e.js @@ -1,2 +1,2 @@ -"use strict"; +'use strict'; (a)=>1; diff --git a/crates/swc_ecma_codegen/tests/test262/71bcb4b846c22c58.js b/crates/swc_ecma_codegen/tests/test262/71bcb4b846c22c58.js index b3e32ae28812..cb9449498c68 100644 --- a/crates/swc_ecma_codegen/tests/test262/71bcb4b846c22c58.js +++ b/crates/swc_ecma_codegen/tests/test262/71bcb4b846c22c58.js @@ -1,4 +1,4 @@ -a["0"]; -a["1"]; -a["00"]; -a["0x20"]; +a['0']; +a['1']; +a['00']; +a['0x20']; diff --git a/crates/swc_ecma_codegen/tests/test262/71e066a0fa01825b.js b/crates/swc_ecma_codegen/tests/test262/71e066a0fa01825b.js index 4c21c321469f..9faacff414d9 100644 --- a/crates/swc_ecma_codegen/tests/test262/71e066a0fa01825b.js +++ b/crates/swc_ecma_codegen/tests/test262/71e066a0fa01825b.js @@ -1 +1 @@ -(" "); +('\11'); diff --git a/crates/swc_ecma_codegen/tests/test262/7305be27a0713dfa.js b/crates/swc_ecma_codegen/tests/test262/7305be27a0713dfa.js index 48effb8a4a12..4fdec3c36963 100644 --- a/crates/swc_ecma_codegen/tests/test262/7305be27a0713dfa.js +++ b/crates/swc_ecma_codegen/tests/test262/7305be27a0713dfa.js @@ -1,6 +1,6 @@ do { // do not optimize it (function() { - a("b"); + a('b'); }()); }while (c); diff --git a/crates/swc_ecma_codegen/tests/test262/76a46be6c2f09fa3.js b/crates/swc_ecma_codegen/tests/test262/76a46be6c2f09fa3.js index ed77876779d4..946458e624d4 100644 --- a/crates/swc_ecma_codegen/tests/test262/76a46be6c2f09fa3.js +++ b/crates/swc_ecma_codegen/tests/test262/76a46be6c2f09fa3.js @@ -1,5 +1,5 @@ function a() { - "use strict"; + 'use strict'; return 1; } ; diff --git a/crates/swc_ecma_codegen/tests/test262/779e65d6349f1616.js b/crates/swc_ecma_codegen/tests/test262/779e65d6349f1616.js index 09258af22849..4c17c156b767 100644 --- a/crates/swc_ecma_codegen/tests/test262/779e65d6349f1616.js +++ b/crates/swc_ecma_codegen/tests/test262/779e65d6349f1616.js @@ -1,5 +1,5 @@ a = typeof 1; -b = typeof "c"; +b = typeof 'c'; d = typeof []; e = typeof {}; f = typeof /./; diff --git a/crates/swc_ecma_codegen/tests/test262/77a541b0502d0bde.js b/crates/swc_ecma_codegen/tests/test262/77a541b0502d0bde.js index d26f9187aad8..969ad59b07b1 100644 --- a/crates/swc_ecma_codegen/tests/test262/77a541b0502d0bde.js +++ b/crates/swc_ecma_codegen/tests/test262/77a541b0502d0bde.js @@ -1 +1,2 @@ -(""); +('\ +'); diff --git a/crates/swc_ecma_codegen/tests/test262/78e1b8a4f3318967.js b/crates/swc_ecma_codegen/tests/test262/78e1b8a4f3318967.js index f03ac2647fc1..9506b9f592dc 100644 --- a/crates/swc_ecma_codegen/tests/test262/78e1b8a4f3318967.js +++ b/crates/swc_ecma_codegen/tests/test262/78e1b8a4f3318967.js @@ -1 +1 @@ -"煎茶"; +"\u{714E}\u{8336}"; diff --git a/crates/swc_ecma_codegen/tests/test262/7b514406528ff126.js b/crates/swc_ecma_codegen/tests/test262/7b514406528ff126.js index c19830489165..b5be987bc0b4 100644 --- a/crates/swc_ecma_codegen/tests/test262/7b514406528ff126.js +++ b/crates/swc_ecma_codegen/tests/test262/7b514406528ff126.js @@ -1 +1 @@ -"Hello\x02World"; +"Hello\02World"; diff --git a/crates/swc_ecma_codegen/tests/test262/7c03e5eb6a9f6f1a.js b/crates/swc_ecma_codegen/tests/test262/7c03e5eb6a9f6f1a.js index 158a0311feb8..52ea9348d4e6 100644 --- a/crates/swc_ecma_codegen/tests/test262/7c03e5eb6a9f6f1a.js +++ b/crates/swc_ecma_codegen/tests/test262/7c03e5eb6a9f6f1a.js @@ -1,4 +1,4 @@ function a() { - "use strict"; + 'use strict'; "\0"; } diff --git a/crates/swc_ecma_codegen/tests/test262/7c9c0cce695bc705.js b/crates/swc_ecma_codegen/tests/test262/7c9c0cce695bc705.js index 26ca4a4d729d..0b28941280e0 100644 --- a/crates/swc_ecma_codegen/tests/test262/7c9c0cce695bc705.js +++ b/crates/swc_ecma_codegen/tests/test262/7c9c0cce695bc705.js @@ -1,9 +1,9 @@ (function() { a(); function a() { - b.c("d"); + b.c('d'); } function a() { - b.c("e"); + b.c('e'); } }()); diff --git a/crates/swc_ecma_codegen/tests/test262/7d8b61ba2a3a275c.js b/crates/swc_ecma_codegen/tests/test262/7d8b61ba2a3a275c.js index a3269813f34d..349495626d83 100644 --- a/crates/swc_ecma_codegen/tests/test262/7d8b61ba2a3a275c.js +++ b/crates/swc_ecma_codegen/tests/test262/7d8b61ba2a3a275c.js @@ -1,4 +1,4 @@ with (a)// do not optimize it (function() { - b("c"); + b('c'); }()); diff --git a/crates/swc_ecma_codegen/tests/test262/7dfb625b91c5c879.js b/crates/swc_ecma_codegen/tests/test262/7dfb625b91c5c879.js index 9053858bc581..e3c8cf7dd0c6 100644 --- a/crates/swc_ecma_codegen/tests/test262/7dfb625b91c5c879.js +++ b/crates/swc_ecma_codegen/tests/test262/7dfb625b91c5c879.js @@ -1,4 +1,4 @@ (function a() { - "use strict"; + 'use strict'; return 1; }); diff --git a/crates/swc_ecma_codegen/tests/test262/7e6e3b4c766a4d33.js b/crates/swc_ecma_codegen/tests/test262/7e6e3b4c766a4d33.js index 3723a3b71060..230665df1e59 100644 --- a/crates/swc_ecma_codegen/tests/test262/7e6e3b4c766a4d33.js +++ b/crates/swc_ecma_codegen/tests/test262/7e6e3b4c766a4d33.js @@ -1 +1 @@ -(a = b("100")) <= a; +(a = b('100')) <= a; diff --git a/crates/swc_ecma_codegen/tests/test262/7f88f149f16fe97a.js b/crates/swc_ecma_codegen/tests/test262/7f88f149f16fe97a.js index b8dfdc985986..93d878693ed0 100644 --- a/crates/swc_ecma_codegen/tests/test262/7f88f149f16fe97a.js +++ b/crates/swc_ecma_codegen/tests/test262/7f88f149f16fe97a.js @@ -1,4 +1,4 @@ var a = { - "arguments": 1, - "eval": 2 + 'arguments': 1, + 'eval': 2 }; diff --git a/crates/swc_ecma_codegen/tests/test262/7fe89d8edf6e778a.js b/crates/swc_ecma_codegen/tests/test262/7fe89d8edf6e778a.js index 06838cc8c633..67255f1e95be 100644 --- a/crates/swc_ecma_codegen/tests/test262/7fe89d8edf6e778a.js +++ b/crates/swc_ecma_codegen/tests/test262/7fe89d8edf6e778a.js @@ -1 +1 @@ -"a&b"; +'a\u0026b'; diff --git a/crates/swc_ecma_codegen/tests/test262/802658d6ef9a83ec.js b/crates/swc_ecma_codegen/tests/test262/802658d6ef9a83ec.js index 71cedc44eddd..a5b2e78a111d 100644 --- a/crates/swc_ecma_codegen/tests/test262/802658d6ef9a83ec.js +++ b/crates/swc_ecma_codegen/tests/test262/802658d6ef9a83ec.js @@ -1,4 +1,4 @@ ({ - ["__proto__"]: 1, + ['__proto__']: 1, __proto__: 2 }); diff --git a/crates/swc_ecma_codegen/tests/test262/81a0322e554af8da.js b/crates/swc_ecma_codegen/tests/test262/81a0322e554af8da.js index 0314b38fb49c..62958a1bfdcb 100644 --- a/crates/swc_ecma_codegen/tests/test262/81a0322e554af8da.js +++ b/crates/swc_ecma_codegen/tests/test262/81a0322e554af8da.js @@ -1,3 +1,3 @@ (function() { - a(typeof b === "c"); + a(typeof b === 'c'); }()); diff --git a/crates/swc_ecma_codegen/tests/test262/84f901eb37273117.js b/crates/swc_ecma_codegen/tests/test262/84f901eb37273117.js index 3c782a716d0d..0acb77385d9d 100644 --- a/crates/swc_ecma_codegen/tests/test262/84f901eb37273117.js +++ b/crates/swc_ecma_codegen/tests/test262/84f901eb37273117.js @@ -1 +1 @@ -("\0"); +('\0'); diff --git a/crates/swc_ecma_codegen/tests/test262/85263ecacc7a4dc5.js b/crates/swc_ecma_codegen/tests/test262/85263ecacc7a4dc5.js index c923b70bc630..2c9840606a2d 100644 --- a/crates/swc_ecma_codegen/tests/test262/85263ecacc7a4dc5.js +++ b/crates/swc_ecma_codegen/tests/test262/85263ecacc7a4dc5.js @@ -1,4 +1,4 @@ (function() { - "use strict"; + 'use strict'; function a() {} }); diff --git a/crates/swc_ecma_codegen/tests/test262/85d6723f13f33101.js b/crates/swc_ecma_codegen/tests/test262/85d6723f13f33101.js index 868d7be8329d..0de893259026 100644 --- a/crates/swc_ecma_codegen/tests/test262/85d6723f13f33101.js +++ b/crates/swc_ecma_codegen/tests/test262/85d6723f13f33101.js @@ -1 +1 @@ -({ "a": b } = 1); +({ 'a': b } = 1); diff --git a/crates/swc_ecma_codegen/tests/test262/88827d8021b5b3ab.js b/crates/swc_ecma_codegen/tests/test262/88827d8021b5b3ab.js index f42d8a45f505..1f4267efbb18 100644 --- a/crates/swc_ecma_codegen/tests/test262/88827d8021b5b3ab.js +++ b/crates/swc_ecma_codegen/tests/test262/88827d8021b5b3ab.js @@ -1 +1 @@ -new a("aa, bb", "return aa;"); +new a("aa, bb", 'return aa;'); diff --git a/crates/swc_ecma_codegen/tests/test262/88c21621e3e8bba0.js b/crates/swc_ecma_codegen/tests/test262/88c21621e3e8bba0.js index a1a575c76e02..359f81e25994 100644 --- a/crates/swc_ecma_codegen/tests/test262/88c21621e3e8bba0.js +++ b/crates/swc_ecma_codegen/tests/test262/88c21621e3e8bba0.js @@ -1 +1 @@ -("a"); +('a'); diff --git a/crates/swc_ecma_codegen/tests/test262/8af69d8f15295ed2.js b/crates/swc_ecma_codegen/tests/test262/8af69d8f15295ed2.js index 26904a86afc4..1ebbb40af57c 100644 --- a/crates/swc_ecma_codegen/tests/test262/8af69d8f15295ed2.js +++ b/crates/swc_ecma_codegen/tests/test262/8af69d8f15295ed2.js @@ -1 +1 @@ -("\u2028"); +('
'); diff --git a/crates/swc_ecma_codegen/tests/test262/8d6ab6352a3f7fa0.js b/crates/swc_ecma_codegen/tests/test262/8d6ab6352a3f7fa0.js index 7386fce8a4d6..b12756669c2c 100644 --- a/crates/swc_ecma_codegen/tests/test262/8d6ab6352a3f7fa0.js +++ b/crates/swc_ecma_codegen/tests/test262/8d6ab6352a3f7fa0.js @@ -1 +1 @@ -(a = b("100")) >= a; +(a = b('100')) >= a; diff --git a/crates/swc_ecma_codegen/tests/test262/8e3f0660b32fbfd2.js b/crates/swc_ecma_codegen/tests/test262/8e3f0660b32fbfd2.js index 81f9349912ef..319aabc21f35 100644 --- a/crates/swc_ecma_codegen/tests/test262/8e3f0660b32fbfd2.js +++ b/crates/swc_ecma_codegen/tests/test262/8e3f0660b32fbfd2.js @@ -1 +1 @@ -("\x07a"); +('\7a'); diff --git a/crates/swc_ecma_codegen/tests/test262/8ef08a335a7f5966.js b/crates/swc_ecma_codegen/tests/test262/8ef08a335a7f5966.js index e854f96a4041..e6b785c32c33 100644 --- a/crates/swc_ecma_codegen/tests/test262/8ef08a335a7f5966.js +++ b/crates/swc_ecma_codegen/tests/test262/8ef08a335a7f5966.js @@ -1,2 +1,2 @@ -a.b("c"); +a.b('c'); a.b.d(a, arguments); diff --git a/crates/swc_ecma_codegen/tests/test262/8f8bfb27569ac008.js b/crates/swc_ecma_codegen/tests/test262/8f8bfb27569ac008.js index d5e8ae7b45c3..2c895c6fb705 100644 --- a/crates/swc_ecma_codegen/tests/test262/8f8bfb27569ac008.js +++ b/crates/swc_ecma_codegen/tests/test262/8f8bfb27569ac008.js @@ -1,2 +1,2 @@ -"use strict"; +'use strict'; eval[1] = 2; diff --git a/crates/swc_ecma_codegen/tests/test262/95520bedf0fdd4c9.js b/crates/swc_ecma_codegen/tests/test262/95520bedf0fdd4c9.js index 5dff115d3ec3..0a0916553400 100644 --- a/crates/swc_ecma_codegen/tests/test262/95520bedf0fdd4c9.js +++ b/crates/swc_ecma_codegen/tests/test262/95520bedf0fdd4c9.js @@ -1,6 +1,6 @@ function a() { b, c, d; if (e) { - throw "f"; + throw 'f'; } } diff --git a/crates/swc_ecma_codegen/tests/test262/955c5fedb3931500.js b/crates/swc_ecma_codegen/tests/test262/955c5fedb3931500.js index bff80a58e83d..9b84835a04ea 100644 --- a/crates/swc_ecma_codegen/tests/test262/955c5fedb3931500.js +++ b/crates/swc_ecma_codegen/tests/test262/955c5fedb3931500.js @@ -1 +1 @@ -"a" + "a"; +'a' + 'a'; diff --git a/crates/swc_ecma_codegen/tests/test262/95ab0d795c04ff38.js b/crates/swc_ecma_codegen/tests/test262/95ab0d795c04ff38.js index 648b7cc6f528..afd8b92c0cda 100644 --- a/crates/swc_ecma_codegen/tests/test262/95ab0d795c04ff38.js +++ b/crates/swc_ecma_codegen/tests/test262/95ab0d795c04ff38.js @@ -1 +1 @@ -("I"); +('\111'); diff --git a/crates/swc_ecma_codegen/tests/test262/9681f5d844d7acd0.js b/crates/swc_ecma_codegen/tests/test262/9681f5d844d7acd0.js index 4e3954c55877..4e7f96ab2f6f 100644 --- a/crates/swc_ecma_codegen/tests/test262/9681f5d844d7acd0.js +++ b/crates/swc_ecma_codegen/tests/test262/9681f5d844d7acd0.js @@ -7,4 +7,4 @@ (a)=>{ return b; }; -(a)=>"e"; // Dropping the parens +(a)=>'e'; // Dropping the parens diff --git a/crates/swc_ecma_codegen/tests/test262/9ec644dbf797e95c.js b/crates/swc_ecma_codegen/tests/test262/9ec644dbf797e95c.js index 1240f329c98c..8be419120890 100644 --- a/crates/swc_ecma_codegen/tests/test262/9ec644dbf797e95c.js +++ b/crates/swc_ecma_codegen/tests/test262/9ec644dbf797e95c.js @@ -1 +1 @@ -("`"); +('\`'); diff --git a/crates/swc_ecma_codegen/tests/test262/a11e875c4dd100af.js b/crates/swc_ecma_codegen/tests/test262/a11e875c4dd100af.js index 269d406627dc..e8b95855b275 100644 --- a/crates/swc_ecma_codegen/tests/test262/a11e875c4dd100af.js +++ b/crates/swc_ecma_codegen/tests/test262/a11e875c4dd100af.js @@ -1,4 +1,4 @@ for(var a = 1; a < 2; ++a)// do not optimize it (function() { - b("c"); + b('c'); }()); diff --git a/crates/swc_ecma_codegen/tests/test262/a2042d86c592dd55.js b/crates/swc_ecma_codegen/tests/test262/a2042d86c592dd55.js index f685c6fcae5d..c878b21d6789 100644 --- a/crates/swc_ecma_codegen/tests/test262/a2042d86c592dd55.js +++ b/crates/swc_ecma_codegen/tests/test262/a2042d86c592dd55.js @@ -1,2 +1,2 @@ // NaN => 0/0 -"a" - 1; +'a' - 1; diff --git a/crates/swc_ecma_codegen/tests/test262/a5a01023fef4d506.js b/crates/swc_ecma_codegen/tests/test262/a5a01023fef4d506.js index d8f4483f3f6f..d7edc9bf29d8 100644 --- a/crates/swc_ecma_codegen/tests/test262/a5a01023fef4d506.js +++ b/crates/swc_ecma_codegen/tests/test262/a5a01023fef4d506.js @@ -1,4 +1,4 @@ -a["b"]; -a["in"]; -a["eval"]; -a["arguments"]; +a['b']; +a['in']; +a['eval']; +a['arguments']; diff --git a/crates/swc_ecma_codegen/tests/test262/a5b30a03e9c774af.js b/crates/swc_ecma_codegen/tests/test262/a5b30a03e9c774af.js index 4adb699b92ad..dd0fe6544964 100644 --- a/crates/swc_ecma_codegen/tests/test262/a5b30a03e9c774af.js +++ b/crates/swc_ecma_codegen/tests/test262/a5b30a03e9c774af.js @@ -1,16 +1,16 @@ try { // do not optimize it (function() { - a("b"); + a('b'); }()); } catch (c) { // do not optimize it (function() { - a("b"); + a('b'); }()); } finally{ // do not optimize it (function() { - a("b"); + a('b'); }()); } diff --git a/crates/swc_ecma_codegen/tests/test262/a62c6323a3696fa8.js b/crates/swc_ecma_codegen/tests/test262/a62c6323a3696fa8.js index d26f9187aad8..969ad59b07b1 100644 --- a/crates/swc_ecma_codegen/tests/test262/a62c6323a3696fa8.js +++ b/crates/swc_ecma_codegen/tests/test262/a62c6323a3696fa8.js @@ -1 +1,2 @@ -(""); +('\ +'); diff --git a/crates/swc_ecma_codegen/tests/test262/ab452fc45813857a.js b/crates/swc_ecma_codegen/tests/test262/ab452fc45813857a.js index 8cd36a6719f4..508b2f87fc6c 100644 --- a/crates/swc_ecma_codegen/tests/test262/ab452fc45813857a.js +++ b/crates/swc_ecma_codegen/tests/test262/ab452fc45813857a.js @@ -1,9 +1,9 @@ if (a) { try { - b("try"); + b('try'); } catch (c) {} // do not optimize it (function() { - b("d"); + b('d'); }()); } diff --git a/crates/swc_ecma_codegen/tests/test262/ade301f0d871c610.js b/crates/swc_ecma_codegen/tests/test262/ade301f0d871c610.js index 9427b9ebac7d..f37dbb6edcdd 100644 --- a/crates/swc_ecma_codegen/tests/test262/ade301f0d871c610.js +++ b/crates/swc_ecma_codegen/tests/test262/ade301f0d871c610.js @@ -1 +1 @@ -"HelloRWorld"; +"Hello\122World"; diff --git a/crates/swc_ecma_codegen/tests/test262/afa63b136c835723.js b/crates/swc_ecma_codegen/tests/test262/afa63b136c835723.js index 9ea50afb9466..2cb32e9ba9ac 100644 --- a/crates/swc_ecma_codegen/tests/test262/afa63b136c835723.js +++ b/crates/swc_ecma_codegen/tests/test262/afa63b136c835723.js @@ -1,5 +1,5 @@ ({ a: 1, - get "b" () {}, + get 'b' () {}, set 3 (c){} }); diff --git a/crates/swc_ecma_codegen/tests/test262/afffb6d317e53b92.js b/crates/swc_ecma_codegen/tests/test262/afffb6d317e53b92.js index d26f9187aad8..6ffb1ee7c29f 100644 --- a/crates/swc_ecma_codegen/tests/test262/afffb6d317e53b92.js +++ b/crates/swc_ecma_codegen/tests/test262/afffb6d317e53b92.js @@ -1 +1 @@ -(""); +('\
'); diff --git a/crates/swc_ecma_codegen/tests/test262/b07c5fdc1003316b.js b/crates/swc_ecma_codegen/tests/test262/b07c5fdc1003316b.js index daeebd2ad375..89a81763007b 100644 --- a/crates/swc_ecma_codegen/tests/test262/b07c5fdc1003316b.js +++ b/crates/swc_ecma_codegen/tests/test262/b07c5fdc1003316b.js @@ -1,5 +1,5 @@ switch(a){ - case "b": + case 'b': c(); break; default: diff --git a/crates/swc_ecma_codegen/tests/test262/b1072e92becf06a9.js b/crates/swc_ecma_codegen/tests/test262/b1072e92becf06a9.js index a796229d4ab5..c728be8c61e0 100644 --- a/crates/swc_ecma_codegen/tests/test262/b1072e92becf06a9.js +++ b/crates/swc_ecma_codegen/tests/test262/b1072e92becf06a9.js @@ -1,3 +1,3 @@ (function() { - a(typeof b === "function"); + a(typeof b === 'function'); }()); diff --git a/crates/swc_ecma_codegen/tests/test262/b4bc5f201c297bca.module.js b/crates/swc_ecma_codegen/tests/test262/b4bc5f201c297bca.module.js index 8008fb027596..267556353e89 100644 --- a/crates/swc_ecma_codegen/tests/test262/b4bc5f201c297bca.module.js +++ b/crates/swc_ecma_codegen/tests/test262/b4bc5f201c297bca.module.js @@ -1 +1 @@ -import a, * as b from "baz"; +import a, * as b from 'baz'; diff --git a/crates/swc_ecma_codegen/tests/test262/b5cf21a87ec272d1.js b/crates/swc_ecma_codegen/tests/test262/b5cf21a87ec272d1.js index 9a2aca68156b..537466ed21d6 100644 --- a/crates/swc_ecma_codegen/tests/test262/b5cf21a87ec272d1.js +++ b/crates/swc_ecma_codegen/tests/test262/b5cf21a87ec272d1.js @@ -1 +1 @@ -("\x01"); +('\01'); diff --git a/crates/swc_ecma_codegen/tests/test262/b5d302467c6f2f16.js b/crates/swc_ecma_codegen/tests/test262/b5d302467c6f2f16.js index a59acd7d232d..f5de2d663cb5 100644 --- a/crates/swc_ecma_codegen/tests/test262/b5d302467c6f2f16.js +++ b/crates/swc_ecma_codegen/tests/test262/b5d302467c6f2f16.js @@ -1,5 +1,5 @@ (class { a(b) { - "use strict"; + 'use strict'; } }); diff --git a/crates/swc_ecma_codegen/tests/test262/b6b5e49c97cedebb.js b/crates/swc_ecma_codegen/tests/test262/b6b5e49c97cedebb.js index ca6f06e7a762..1059faee853c 100644 --- a/crates/swc_ecma_codegen/tests/test262/b6b5e49c97cedebb.js +++ b/crates/swc_ecma_codegen/tests/test262/b6b5e49c97cedebb.js @@ -1,3 +1,3 @@ { - "use strict"; + 'use strict'; } diff --git a/crates/swc_ecma_codegen/tests/test262/bd697f0fda948394.js b/crates/swc_ecma_codegen/tests/test262/bd697f0fda948394.js index 93741c40d0d2..45453a957023 100644 --- a/crates/swc_ecma_codegen/tests/test262/bd697f0fda948394.js +++ b/crates/swc_ecma_codegen/tests/test262/bd697f0fda948394.js @@ -1,6 +1,6 @@ (function() { try { - throw "a"; + throw 'a'; } catch (b) {} c(); // This must not be removed. }()); diff --git a/crates/swc_ecma_codegen/tests/test262/be2fd5888f434cbd.js b/crates/swc_ecma_codegen/tests/test262/be2fd5888f434cbd.js index 6b7d918f34c6..27b705e8b9e2 100644 --- a/crates/swc_ecma_codegen/tests/test262/be2fd5888f434cbd.js +++ b/crates/swc_ecma_codegen/tests/test262/be2fd5888f434cbd.js @@ -1,4 +1,4 @@ (function() { - "use\nstrict"; + 'use\nstrict'; with (a); }); diff --git a/crates/swc_ecma_codegen/tests/test262/c1319833fc139cf8.js b/crates/swc_ecma_codegen/tests/test262/c1319833fc139cf8.js index eac23d210d1e..16329f52f6b9 100644 --- a/crates/swc_ecma_codegen/tests/test262/c1319833fc139cf8.js +++ b/crates/swc_ecma_codegen/tests/test262/c1319833fc139cf8.js @@ -1,3 +1,3 @@ var a = { - "0": "b" + '0': 'b' }; diff --git a/crates/swc_ecma_codegen/tests/test262/c52db35cba7fdbc0.js b/crates/swc_ecma_codegen/tests/test262/c52db35cba7fdbc0.js index 3563dc57dc9e..3ebab2f6f572 100644 --- a/crates/swc_ecma_codegen/tests/test262/c52db35cba7fdbc0.js +++ b/crates/swc_ecma_codegen/tests/test262/c52db35cba7fdbc0.js @@ -1,6 +1,6 @@ (function() { try { - throw "a"; + throw 'a'; } finally{ b(); } diff --git a/crates/swc_ecma_codegen/tests/test262/c7e5fba8bf3854cd.js b/crates/swc_ecma_codegen/tests/test262/c7e5fba8bf3854cd.js index ace2e090dc7f186d3ea628b9845950bfa3d570c6..833f791a883feb67467846ee64d9e513c8dce4cd 100644 GIT binary patch literal 47 vcmdN$E6qzT$;{8w&{U}AQUC(=(&AKw;*z4w"; + const y = "<\/script>"; + const z = "\/\/ \\"; + export { x, y, z }; + "# + ); } diff --git a/crates/swc_ecma_compat_es2015/tests/__swc_snapshots__/src/lib.rs/issue_8871.js b/crates/swc_ecma_compat_es2015/tests/__swc_snapshots__/src/lib.rs/issue_8871.js new file mode 100644 index 000000000000..8b13a6238ebf --- /dev/null +++ b/crates/swc_ecma_compat_es2015/tests/__swc_snapshots__/src/lib.rs/issue_8871.js @@ -0,0 +1,4 @@ +var x = ""; +var y = "<\/script>"; +var z = "\/\/ \\"; +export { x, y, z }; diff --git a/node-swc/__tests__/spack/simple_test.js b/node-swc/__tests__/spack/simple_test.js index ca041a6f9cea..7968d7fc12d3 100644 --- a/node-swc/__tests__/spack/simple_test.js +++ b/node-swc/__tests__/spack/simple_test.js @@ -1,38 +1,43 @@ const swc = require("../../../"); -const path = require('path'); +const path = require("path"); - -it('should handle a simple case', async () => { +it("should handle a simple case", async () => { const result = await swc.bundle({ - name: 'simple', + name: "simple", entry: { - simple: path.join(__dirname, '../../tests/spack/simple/a.js') + simple: path.join(__dirname, "../../tests/spack/simple/a.js"), }, }); - console.log(result) + console.log(result); expect(result.simple).toBeTruthy(); - expect(result.simple.code.replace('\n', '')).toBe(`console.log("Foo");`); + expect(result.simple.code).toMatchInlineSnapshot(` + "console.log('Foo'); + " + `); }); -it('should handle loader', async () => { +it("should handle loader", async () => { const result = await swc.bundle({ - name: 'virtual', + name: "virtual", entry: { - simple: path.join(__dirname, '../../tests/spack/simple/a.js') + simple: path.join(__dirname, "../../tests/spack/simple/a.js"), }, module: { rules: { loaders: [ { - test: 'virtual', - } - ] - } - } + test: "virtual", + }, + ], + }, + }, }); - console.log(result) + console.log(result); expect(result.simple).toBeTruthy(); - expect(result.simple.code.replace('\n', '')).toBe(`console.log("Foo");`); -}); \ No newline at end of file + expect(result.simple.code).toMatchInlineSnapshot(` + "console.log('Foo'); + " + `); +}); diff --git a/node-swc/__tests__/transform/api_test.js b/node-swc/__tests__/transform/api_test.js index d86a7988d5f8..a56cf08f1adb 100644 --- a/node-swc/__tests__/transform/api_test.js +++ b/node-swc/__tests__/transform/api_test.js @@ -7,7 +7,7 @@ it("should handle minify", () => { expect( swc .transformSync(src, { - minify: true + minify: true, }) .code.trim() ).toBe(`import foo,{bar}from"foo";`); @@ -16,7 +16,7 @@ it("should handle minify", () => { it("should handle sourceMaps = false", () => { const src = '/* Comment */import foo, {bar} from "foo"'; const out = swc.transformSync(src, { - sourceMaps: false + sourceMaps: false, }); expect(out.map).toBeFalsy(); @@ -28,22 +28,24 @@ it("should handle exportNamespaceFrom", () => { jsc: { parser: { syntax: "ecmascript", - exportNamespaceFrom: true - } - } + exportNamespaceFrom: true, + }, + }, }); - expect(out.code).toContain("import * as _Foo from \"bar\";"); - expect(out.code).toContain("export { _Foo as Foo }"); + expect(out.code).toMatchInlineSnapshot(` + "import * as _Foo from 'bar'; + export { _Foo as Foo }; + " + `); }); - it("should handle jsc.target = es5", () => { const out = swc.transformSync(`foo.default`, { swcrc: false, jsc: { - target: "es5" - } + target: "es5", + }, }); expect(out.code.trim()).toBe(`foo.default;`); }); @@ -53,8 +55,8 @@ it("(sync) should handle module input", () => { const out = swc.transformSync(m, { swcrc: false, jsc: { - target: 'es2016', - } + target: "es2016", + }, }); expect(out.code.replace(/\n/g, "")).toBe("class Foo {}"); @@ -64,8 +66,8 @@ it("(async) should handle module input", async () => { const m = await swc.parse("class Foo {}"); const out = await swc.transform(m, { jsc: { - target: "es2016" - } + target: "es2016", + }, }); expect(out.code.replace(/\n/g, "")).toBe("class Foo {}"); @@ -73,7 +75,7 @@ it("(async) should handle module input", async () => { it("(sync) should handle plugin", () => { const out = swc.transformSync("class Foo {}", { - plugin: m => ({ ...m, body: [] }) + plugin: (m) => ({ ...m, body: [] }), }); expect(out.code).toBe(""); @@ -81,7 +83,7 @@ it("(sync) should handle plugin", () => { it("(async) should handle plugin", async () => { const out = await swc.transform("class Foo {}", { - plugin: m => ({ ...m, body: [] }) + plugin: (m) => ({ ...m, body: [] }), }); expect(out.code).toBe(""); @@ -93,12 +95,14 @@ it("(async) should handle dynamic import", async () => { target: "es3", parser: { syntax: "ecmascript", - dynamicImport: true - } - } + dynamicImport: true, + }, + }, }); - expect(out.code.replace(/;/g, "").trim()).toBe(`import("foo")`); + expect(out.code.replace(/;/g, "").trim()).toMatchInlineSnapshot( + `"import('foo')"` + ); }); it("should handle nullish coalescing", async () => { @@ -106,13 +110,15 @@ it("should handle nullish coalescing", async () => { jsc: { parser: { syntax: "ecmascript", - nullishCoalescing: true - } - } + nullishCoalescing: true, + }, + }, }); - expect(out.code).toBe(`a !== null && a !== void 0 ? a : "foo"; -`); + expect(out.code).toMatchInlineSnapshot(` + "a !== null && a !== void 0 ? a : 'foo'; + " + `); }); it("should handle for of statement in an async function", async () => { @@ -123,33 +129,25 @@ it("should handle for of statement in an async function", async () => { }` ); - expect(out.code).toBeTruthy() + expect(out.code).toBeTruthy(); }); - it("should respect isModule = false", async () => { - const out = swc.transformSync( - `const five = 005`, - { - isModule: false, - } - ); + const out = swc.transformSync(`const five = 005`, { + isModule: false, + }); - expect(out.code.trim()).toEqual(`var five = 005;`) + expect(out.code.trim()).toEqual(`var five = 005;`); }); it("should respect isModule = true", async () => { - const f = () => swc.transformSync( - `const five = 005`, - { + const f = () => + swc.transformSync(`const five = 005`, { isModule: true, - } - ); - expect(f).toThrowError(/Syntax Error/) + }); + expect(f).toThrowError(/Syntax Error/); }); - - it("should respect `inlineSourcesContent`", async () => { const src = '/* Comment */import foo, {bar} from "foo"'; const { map } = await swc.transform(src, { @@ -159,21 +157,20 @@ it("should respect `inlineSourcesContent`", async () => { const j = JSON.parse(map); - expect(j).toHaveProperty('sourcesContent') + expect(j).toHaveProperty("sourcesContent"); }); it("should respect `error.filename = false`", async () => { - const src = 'export default

'; + const src = "export default

"; try { await swc.transform(src, { error: { - filename: false - } - }) + filename: false, + }, + }); } catch (e) { - expect(e).not.toContain("-->") + expect(e).not.toContain("-->"); } - }); it("should support overring `jsc.externalHelpers` using js api", async () => { @@ -184,8 +181,8 @@ it("should support overring `jsc.externalHelpers` using js api", async () => { const { code } = await swc.transformFile(filename, { jsc: { externalHelpers: false, - } - }) + }, + }); - expect(code).toContain('function _class_call_check') -}); \ No newline at end of file + expect(code).toContain("function _class_call_check"); +}); diff --git a/node-swc/__tests__/transform/experimental.mjs b/node-swc/__tests__/transform/experimental.mjs index 71d12d6a804d..2e0b73974ae6 100644 --- a/node-swc/__tests__/transform/experimental.mjs +++ b/node-swc/__tests__/transform/experimental.mjs @@ -23,7 +23,7 @@ describe("when jsc.experimentalDisableBuiltinTransforms is true", () => { expect(code).toMatchInlineSnapshot(` "const hello: Type = ()=>{ - console.log("hello"); + console.log('hello'); }; " `); diff --git a/node-swc/__tests__/transform/optimizer_test.js b/node-swc/__tests__/transform/optimizer_test.js index 4128526f6f7e..eff3b452677c 100644 --- a/node-swc/__tests__/transform/optimizer_test.js +++ b/node-swc/__tests__/transform/optimizer_test.js @@ -1,24 +1,26 @@ -const swc = require('../../../'); +const swc = require("../../../"); -it('should perform dce', () => { - const out = swc.transformSync(`if (__DEBUG__) { +it("should perform dce", () => { + const out = swc.transformSync( + `if (__DEBUG__) { console.log('Foo') - }`, { - jsc: { - transform: { - optimizer: { - simplify: true, - globals: { - vars: { - __DEBUG__: 'true' + }`, + { + jsc: { + transform: { + optimizer: { + simplify: true, + globals: { + vars: { + __DEBUG__: "true", + }, }, - } - } - } + }, + }, + }, } - } ); expect(out.map).toBeFalsy(); - expect(out.code.trim()).toBe(`console.log("Foo");`); -}); \ No newline at end of file + expect(out.code.trim()).toMatchInlineSnapshot(`"console.log('Foo');"`); +}); diff --git a/node-swc/src/binding.js b/node-swc/src/binding.js index 83abe814656b..4da601ca9b79 100644 --- a/node-swc/src/binding.js +++ b/node-swc/src/binding.js @@ -2,14 +2,10 @@ /* eslint-disable */ /* auto-generated by NAPI-RS */ -const { existsSync, readFileSync } = require('fs') -const { join } = require('path') - -const { platform, arch } = process +const { readFileSync } = require('fs') let nativeBinding = null -let localFileExisted = false -let loadError = null +const loadErrors = [] const isMusl = () => { let musl = false @@ -60,255 +56,281 @@ const isMuslFromChildProcess = () => { } } -switch (platform) { - case 'android': - switch (arch) { - case 'arm64': - localFileExisted = existsSync(join(__dirname, 'swc.android-arm64.node')) - try { - if (localFileExisted) { - nativeBinding = require('./swc.android-arm64.node') - } else { - nativeBinding = require('@swc/core-android-arm64') - } - } catch (e) { - loadError = e - } - break - case 'arm': - localFileExisted = existsSync(join(__dirname, 'swc.android-arm-eabi.node')) - try { - if (localFileExisted) { - nativeBinding = require('./swc.android-arm-eabi.node') - } else { - nativeBinding = require('@swc/core-android-arm-eabi') - } - } catch (e) { - loadError = e - } - break - default: - throw new Error(`Unsupported architecture on Android ${arch}`) +function requireNative() { + if (process.platform === 'android') { + if (process.arch === 'arm64') { + try { + return require('./swc.android-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@swc/core-android-arm64') + } catch (e) { + loadErrors.push(e) + } + + } else if (process.arch === 'arm') { + try { + return require('./swc.android-arm-eabi.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@swc/core-android-arm-eabi') + } catch (e) { + loadErrors.push(e) + } + + } else { + loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`)) + } + } else if (process.platform === 'win32') { + if (process.arch === 'x64') { + try { + return require('./swc.win32-x64-msvc.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@swc/core-win32-x64-msvc') + } catch (e) { + loadErrors.push(e) + } + + } else if (process.arch === 'ia32') { + try { + return require('./swc.win32-ia32-msvc.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@swc/core-win32-ia32-msvc') + } catch (e) { + loadErrors.push(e) + } + + } else if (process.arch === 'arm64') { + try { + return require('./swc.win32-arm64-msvc.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@swc/core-win32-arm64-msvc') + } catch (e) { + loadErrors.push(e) + } + + } else { + loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`)) } - break - case 'win32': - switch (arch) { - case 'x64': - localFileExisted = existsSync( - join(__dirname, 'swc.win32-x64-msvc.node') - ) + } else if (process.platform === 'darwin') { + try { + return require('./swc.darwin-universal.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@swc/core-darwin-universal') + } catch (e) { + loadErrors.push(e) + } + + if (process.arch === 'x64') { + try { + return require('./swc.darwin-x64.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@swc/core-darwin-x64') + } catch (e) { + loadErrors.push(e) + } + + } else if (process.arch === 'arm64') { + try { + return require('./swc.darwin-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@swc/core-darwin-arm64') + } catch (e) { + loadErrors.push(e) + } + + } else { + loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`)) + } + } else if (process.platform === 'freebsd') { + if (process.arch === 'x64') { + try { + return require('./swc.freebsd-x64.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@swc/core-freebsd-x64') + } catch (e) { + loadErrors.push(e) + } + + } else if (process.arch === 'arm64') { + try { + return require('./swc.freebsd-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@swc/core-freebsd-arm64') + } catch (e) { + loadErrors.push(e) + } + + } else { + loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`)) + } + } else if (process.platform === 'linux') { + if (process.arch === 'x64') { + if (isMusl()) { try { - if (localFileExisted) { - nativeBinding = require('./swc.win32-x64-msvc.node') - } else { - nativeBinding = require('@swc/core-win32-x64-msvc') - } - } catch (e) { - loadError = e - } - break - case 'ia32': - localFileExisted = existsSync( - join(__dirname, 'swc.win32-ia32-msvc.node') - ) + return require('./swc.linux-x64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@swc/core-linux-x64-musl') + } catch (e) { + loadErrors.push(e) + } + + } else { try { - if (localFileExisted) { - nativeBinding = require('./swc.win32-ia32-msvc.node') - } else { - nativeBinding = require('@swc/core-win32-ia32-msvc') - } - } catch (e) { - loadError = e - } - break - case 'arm64': - localFileExisted = existsSync( - join(__dirname, 'swc.win32-arm64-msvc.node') - ) + return require('./swc.linux-x64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@swc/core-linux-x64-gnu') + } catch (e) { + loadErrors.push(e) + } + + } + } else if (process.arch === 'arm64') { + if (isMusl()) { try { - if (localFileExisted) { - nativeBinding = require('./swc.win32-arm64-msvc.node') - } else { - nativeBinding = require('@swc/core-win32-arm64-msvc') - } - } catch (e) { - loadError = e - } - break - default: - throw new Error(`Unsupported architecture on Windows: ${arch}`) - } - break - case 'darwin': - localFileExisted = existsSync(join(__dirname, 'swc.darwin-universal.node')) - try { - if (localFileExisted) { - nativeBinding = require('./swc.darwin-universal.node') + return require('./swc.linux-arm64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@swc/core-linux-arm64-musl') + } catch (e) { + loadErrors.push(e) + } + } else { - nativeBinding = require('@swc/core-darwin-universal') + try { + return require('./swc.linux-arm64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@swc/core-linux-arm64-gnu') + } catch (e) { + loadErrors.push(e) + } + } - break - } catch {} - switch (arch) { - case 'x64': - localFileExisted = existsSync(join(__dirname, 'swc.darwin-x64.node')) + } else if (process.arch === 'arm') { + try { + return require('./swc.linux-arm-gnueabihf.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@swc/core-linux-arm-gnueabihf') + } catch (e) { + loadErrors.push(e) + } + + } else if (process.arch === 'riscv64') { + if (isMusl()) { try { - if (localFileExisted) { - nativeBinding = require('./swc.darwin-x64.node') - } else { - nativeBinding = require('@swc/core-darwin-x64') - } - } catch (e) { - loadError = e - } - break - case 'arm64': - localFileExisted = existsSync( - join(__dirname, 'swc.darwin-arm64.node') - ) + return require('./swc.linux-riscv64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@swc/core-linux-riscv64-musl') + } catch (e) { + loadErrors.push(e) + } + + } else { try { - if (localFileExisted) { - nativeBinding = require('./swc.darwin-arm64.node') - } else { - nativeBinding = require('@swc/core-darwin-arm64') - } - } catch (e) { - loadError = e - } - break - default: - throw new Error(`Unsupported architecture on macOS: ${arch}`) + return require('./swc.linux-riscv64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@swc/core-linux-riscv64-gnu') + } catch (e) { + loadErrors.push(e) + } + + } + } else if (process.arch === 's390x') { + try { + return require('./swc.linux-s390x-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + return require('@swc/core-linux-s390x-gnu') + } catch (e) { + loadErrors.push(e) + } + + } else { + loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`)) } - break - case 'freebsd': - if (arch !== 'x64') { - throw new Error(`Unsupported architecture on FreeBSD: ${arch}`) + } else { + loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`)) + } +} + +nativeBinding = requireNative() + +if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { + try { + nativeBinding = require('./swc.wasi.cjs') + } catch (err) { + if (process.env.NAPI_RS_FORCE_WASI) { + console.error(err) } - localFileExisted = existsSync(join(__dirname, 'swc.freebsd-x64.node')) + } + if (!nativeBinding) { try { - if (localFileExisted) { - nativeBinding = require('./swc.freebsd-x64.node') - } else { - nativeBinding = require('@swc/core-freebsd-x64') + nativeBinding = require('@swc/core-wasm32-wasi') + } catch (err) { + if (process.env.NAPI_RS_FORCE_WASI) { + console.error(err) } - } catch (e) { - loadError = e - } - break - case 'linux': - switch (arch) { - case 'x64': - if (isMusl()) { - localFileExisted = existsSync( - join(__dirname, 'swc.linux-x64-musl.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./swc.linux-x64-musl.node') - } else { - nativeBinding = require('@swc/core-linux-x64-musl') - } - } catch (e) { - loadError = e - } - } else { - localFileExisted = existsSync( - join(__dirname, 'swc.linux-x64-gnu.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./swc.linux-x64-gnu.node') - } else { - nativeBinding = require('@swc/core-linux-x64-gnu') - } - } catch (e) { - loadError = e - } - } - break - case 'arm64': - if (isMusl()) { - localFileExisted = existsSync( - join(__dirname, 'swc.linux-arm64-musl.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./swc.linux-arm64-musl.node') - } else { - nativeBinding = require('@swc/core-linux-arm64-musl') - } - } catch (e) { - loadError = e - } - } else { - localFileExisted = existsSync( - join(__dirname, 'swc.linux-arm64-gnu.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./swc.linux-arm64-gnu.node') - } else { - nativeBinding = require('@swc/core-linux-arm64-gnu') - } - } catch (e) { - loadError = e - } - } - break - case 'arm': - localFileExisted = existsSync( - join(__dirname, 'swc.linux-arm-gnueabihf.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./swc.linux-arm-gnueabihf.node') - } else { - nativeBinding = require('@swc/core-linux-arm-gnueabihf') - } - } catch (e) { - loadError = e - } - break - case 'riscv64': - if (isMusl()) { - localFileExisted = existsSync( - join(__dirname, 'swc.linux-riscv64-musl.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./swc.linux-riscv64-musl.node') - } else { - nativeBinding = require('@swc/core-linux-riscv64-musl') - } - } catch (e) { - loadError = e - } - } else { - localFileExisted = existsSync( - join(__dirname, 'swc.linux-riscv64-gnu.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./swc.linux-riscv64-gnu.node') - } else { - nativeBinding = require('@swc/core-linux-riscv64-gnu') - } - } catch (e) { - loadError = e - } - } - break - default: - throw new Error(`Unsupported architecture on Linux: ${arch}`) } - break - default: - throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`) + } } if (!nativeBinding) { - if (loadError) { - throw loadError + if (loadErrors.length > 0) { + // TODO Link to documentation with potential fixes + // - The package owner could build/publish bindings for this arch + // - The user may need to bundle the correct files + // - The user may need to re-install node_modules to get new packages + throw new Error('Failed to load native binding', { cause: loadErrors }) } throw new Error(`Failed to load native binding`) }